php - Array with MySQL query results -
this question has answer here:
i'm trying result of mysql query in php array.
basically, query supposed list of unique page_id table. result should displayed in div.
this code i'm using:
$query = "select distinct page_id hist" ; $paginas=array(); $result=mysqli_query($link,$query) or die(mysql_error()); while ($row=mysql_fetch_array($result)){ $paginas=array_fill(count($paginas), 46, $row['page_id']); }; mysqli_close($link); echo '<div id="paginas">'; print_r ($paginas); echo "</div>";
this giving me empty array (displays "array()") , error: warning: mysql_fetch_array() expects parameter 1 resource, object given in (my line 4 above)
it's because mixing mysqli
functions mysql_
Comments
Post a Comment