Sorry for the beginners question.
I've searched for an hour now, and can only find info on adding 1 key => value inside the while loop.
I'm aiming for this result. Thanks
$menu = array(
'1' => array('id' => 1, 'parentid' => 0, 'title' => 'Apple'),
'2' => array('id' => 2, 'parentid' => 0, 'title' => 'Banana'),
'3' => array('id' => 3, 'parentid' => 0, 'title' => 'Tangerine'),
'4' => array('id' => 4, 'parentid' => 3, 'title' => 'Pear')
);
I've tried a number of things but this seems to be the closest.
$menu = array();
while($row = mysql_fetch_array($query)) {
$menu[] = $row['id'] ;
$menu[] = $row['parentid'] ;
$menu[] = $row['title'];
}