Hello,
I have a database that has several columns...one being BUSINESS NAME, another CATEGORY and a third of CATEGORY2- along with some others.
I would like to have a dropdown menu that would list all the CATEGORY and CATEGORY2 entries together without any repeats of categories.
Here is an example of what the database would look like:
BUSINESS CATEGORY CATEGORY2
Joe's Shoes Clothing
Ace Photography Photography Graphic Design
Sue's Designs Graphic Design
So the dropdown (in alphabetical order) would look like this:
Clothing
Graphic Design
Photography
Now if someone selected Graphic Design they would get a search result that listed both businesses in the database and their contact information.
Right now the script I have just works for a single CATEGORY column and looks like this (only part of the script):
$sql = "SELECT DISTINCT category FROM table ORDER BY category";
echo '<option value="' . $row['category'] . '">' . $row['category'] . '</option>';
Any ideas how I can add the CATEGORY2 column to the scripting so that it does what I mentioned above??
Appreciate your help in advance!!!