RE: [PHP] array headaches

2001-02-22 Thread PHPBeginner.com
what I think you've missed is your array starts with []['string'] remove []... $menu['name'] = ... should work ... unless your code is a little specific Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com

Re: [PHP] array headaches

2001-02-21 Thread Jason Stechschulte
while($db-next_record()) { $menu[]["name"] = $db-f("name"); $menu[]["url"] = $db-f("topic_id"); } Why not use a for loop instead? for($i = 0; $db-next_record(); $i++) { $menu[$i]["name"] = $db-f("name"); $menu[$i]["url"] = $db-f("topic_id"); } Then you can access them through

RE: [PHP] array headaches

2001-02-21 Thread Matt Williams
quot;.$subarray["name"]."abr\n"; } is there any better way of doing this?? thanks M@ -Original Message- From: Pavel Kalian [mailto:[EMAIL PROTECTED]] Sent: 21 February 2001 15:00 To: Matt Williams; [EMAIL PROTECTED]; PHP_UK@egroups.

Re: [PHP] array headaches

2001-02-21 Thread David Robley
On Thu, 22 Feb 2001 02:11, Matt Williams wrote: I have done it this way... $menu = array(); $count = $db-num_rows(); for($i = 0; $db-next_record(); $i++) { $menu[$i]["name"] = $db-f("name"); $menu[$i]["url"] = $db-f("topic_id"); }