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
-----Original Message-----
From: Matt Williams [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:57 PM
To: [EMAIL PROTECTED]; PHP_UK@egroups. com
Subject: [PHP] array headaches
Hi
could anybody please help me get my head around the following.
I get some url information from the database (title, url)
I am trying to then put this into an array so I can pass it to the page to
display a menu.
so
a) how do I get the data into the array. would this be the way to do it??
$menu = array();
while($db->next_record())
{
$menu[]["name"] = $db->f("name");
$menu[]["url"] = $db->f("topic_id");
}
which leads me onto
b) how do I get the data back out. I can't test to see if the above works as
I can't get at the data
TIA
M@
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]