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
Post a Comment