Click here to Skip to main content
15,867,939 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I will have two drop down menu's like this:


The first drop down menu will have a list of pre determined business categories, the second will populate all of the business' listed for the selected category only after a category is selected from the first dropdown.

This is a general idea behind the categories I am using:
HTML
<select id="category">
<option>Restauraunts</option>
<option>Legal</option>
<option>Fitness</option>
<option>Motorcycle</option>
<option>Sports</option>
</select>


Each one of the selections will be a business category. A user will select a category from the select box on my front page. It will query the database for all business's listed in that category and load those business names into a second select box on the same page below the first.

I am looking for direction on how to do this. I am new to this, thank you for the help!
Posted
Updated 22-Jul-14 11:53am
v5
Comments
Sergey Alexandrovich Kryukov 22-Jul-14 16:39pm    
Java?! Or PHP?! Where is Java or PHP here? Didn't you put wrong tag(s)? What is your server-side technology? And what prevents you from reading on the database topics using either Java or PHP?
The question makes no sense, just yet.
—SA
Member 10964144 22-Jul-14 17:02pm    
Sorry, I'm looking to use PHP & or Java to do it, not sure how to go about it though.
Member 10964144 22-Jul-14 17:43pm    
I want to learn how to do this as I'm in the process of learning PHP.

Basically, I want to be able to select a category from the first select box, then have on the Selected Index Change I want it to query SELECT BusinessName FROM database WHERE category=''; based upon the selected category and fill the second select box with all the business' listed in the database under that category.

1 solution

Check this out: Populate another select dropdown from database based on dropdown selection[^]
Besides PHP, you also have to learn SQL.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900