How to do a "case" like loop with an array?

From: Date: Mon, 11 Sep 2000 02:30:27 +0000
Subject: How to do a "case" like loop with an array?
Groups: php.general 
Request: Send a blank email to php-general+get-16108@lists.php.net to get a copy of this message
I have database table that is called categories. The table holds the variable names for <option>'s in a <select> list. I did this so if I added a new category, it would not require any code change to create the code list. It really words GREAT. Here's the problem: If I want to modify a product (from another table), I had the php file hardcoded with the categories, and used a case statement to automatically display the correct <option>, and then continue filling in the other <option> underneath. Now that I have this new "dynamic" way of populating the <select> list, I am baffled when it comes to creating the list dynamically while having the correct <option> to be selected..... Any ideas????? Thanks SO Much!!! Shane

« previous php.general (#16108) next »