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
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
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.
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");
}
4 matches
Mail list logo