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 -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -