Can I do Array("2" => "Value", "
Posted: Wed Oct 19, 2005 8:11 am
feyd | Please use
How I think (it's an outline, and I know this wont work):
Where "2" is the auto_increment value for the record and "ItemOne" is the corresponding value.
What I'd like is to generate a list of menu items based on its auto_increment ID in the database and the set menu item value (text).
Any hints, anyone?
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Is it possible to create an array like this based on auto_increment value and a set text value by iterating through a list of records?Code: Select all
$list = array(
"2" => "ItemOne",
"5" => "ItemTwo",
"21" => "ItemThree",
"32" => "ItemFour",
"43" => "ItemFive",
);Code: Select all
$categories = array();
$counter = 0;
while($row = $connector->fetchArray($result)){
$categories[$counter] = $row['ID'] . ' => ' . $row['Item'];
$counter++;
}Where "2" is the auto_increment value for the record and "ItemOne" is the corresponding value.
What I'd like is to generate a list of menu items based on its auto_increment ID in the database and the set menu item value (text).
Any hints, anyone?
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]