php - Array with MySQL query results -


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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -