populating combo boxes from database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stocktest
Forum Newbie
Posts: 1
Joined: Thu Jul 28, 2005 4:31 am

populating combo boxes from database

Post by stocktest »

I am new to php.i have to combo boxes namely combo1 and combo2.
The values of combo2 has to be populated dynamically from database based on the value selected in combo1.

I want to know how to achieve the above scenario.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

that sounds like you should load all the lists in and then use javascript to put whichever list you want into combo2 based on the selection in combo1. i dont think you want to use php for this unless you want them to submit the data every time they change the selection in combo1
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Post by harrisonad »

as what he said, php is server side. But, if you have to change the contents of your combobox 2 instantly, use javascript.
look at this
viewtopic.php?t=29084
Post Reply