while (list($k, $v) = each ($rowmenu)) { $val[] = $v; } } try that -----Original Message----- From: Awlad Hussain [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 8:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Array
What wrong with this code? i am tryin to create an array from the while loop, but i only get one value :( while($rowmenu = mysql_fetch_array($resultmenu)){ while (list($k, $v) = each ($rowmenu)) { $val[$k] = $v; } } Basically the $rowmenu returns more than one records.. and i want to put the keys and vlaues of $rowmenu into an array any idea?? awlad _______________________________________________________________________ Sheridan Phoenix Company The Business Centre Kimpton Road Luton Bedfordshire LU2 0LB Email: [EMAIL PROTECTED] Phone: 01582 522 330 Fax: 01582 522 328 _______________________________________________________________________ This electronic transmission is strictly confidential and intended solely for the addressee. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission. If you have received this transmission in error it would be helpful if you could notify The Sheridan Phoenix Company Ltd as soon as possible. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Sheridan Phoenix Company Ltd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php