MySQL table to array – PHP

$query = mysqli_query($mySQLiConnection, "SELECT * FROM table WHERE 1=1");

$array = array();

// look through query
while($row = mysqli_fetch_assoc($query)){
  // add each row returned into an array
  $array[] = $row;
  // OR just echo the data:
  echo $row['username']; // etc


Author: Wojciech Borowicz

I hope this post will help you to do what you need.
In case you want some assistance click here to get in touch 

check out other blog posts