php - How to save all query results into an array -


i'm trying store query results array. i've table 50 rows , 6 columns, how save 50 values array? problem save array like:

value1 - red - metal - 100 - in stock - price

so each cell of array must have organization.

you can use 2 dimensional array in manner

 $sql = "select * table";     $result = mysql_query($query);      $myarray = array();     while(*emphasized text*$arrayresult = mysql_fetch_array($result)) {        $myarray[] = array(                         'id'=>$arrayresult['id'],                         'title'=>$arrayresult['title']                     );     } 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -