I'm using the global function $ with; and the error went but I do not know if it's okay to use it in each function and if PHP5 works the same well that in PHP7
Error:
Warning: mysqli_query (): Could not fetch mysqli in C: \ xampp \ htdocs \ new \ trending.php on line 19
Warning: mysqli_num_rows () expects parameter 1 to be mysqli_result, null given in C: \ xampp \ htdocs \ new \ trending.php on line 21
code:
$sql = mysqli_query($con,"Select * From trending, ORDER BY top DESC LIMIT 13");
if (mysqli_num_rows($sql) == 0)
{
for ($n=1;$n<=12;$n++){
echo'<div class="div_css_one">';
echo'#</div>';
echo'<div class="div_css_one_b">';
echo'</div>';
}
}else{
while($data = mysqli_fetch_array($sql, MYSQLI_ASSOC)) {
echo '<li><a href="hashtag?hashtag='.$data['hashtag'].'"><p class="font-weight">#'.$data['hashtag'].'</p></a><spam class="trending_post_top">'.$data['top'].' posts</spam><li>';
}
}