Mysql results into array (PHP)
- by cthulhu
How can i convert mysql results (from mysql_fetch_array) into such a form?
$some = array(
"comments" => array(
array( "text" => "hi", "id" => "1" ),
array( "text" => "hi", "id" => "2" ),
array( "text" => "hi", "id" => "3" ),
array( "text" => "hi", "id" => "4" )
)
);
while the db looks like:
comments
id text
1 blabla bla
2 bla bla
i've tried to fetch the values with foreach/while and insert it into two arrays but no
success...