Re: array headaches
| From: | Jason Stechschulte | Date: | Wed, 21 Feb 2001 15:31:47 +0000 |
| Subject: | Re: array headaches | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40969@lists.php.net to get a copy of this message | ||
> 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 another loop.
--
Jason Stechschulte
jpstech@unoh.edu
--
Reserve your abuse for your true friends.
-- Larry Wall in <199712041852.KAA19364@wall.org>