Forum Moderators: coopster

Message Too Old, No Replies

Auto-Populate From Database?

Auto-Populate a table from a Database and dropdown menu

         

alkaholik

6:27 pm on Nov 22, 2006 (gmt 0)

10+ Year Member



Basically I want to do this:

but only one drop down menu.

I have a ton of rows in a table on a database, and I want to be able to select from a drop down a week number, and have it auto populate the table on the webpage with only the rows that have that week number in them.

Thanks

Im not sure but I right now I have a table set up with all the info from the database showing all the records, I have modifided it so it only selects from the database WHERE week = "$weeknum" but what i need is to have a drop down that sets $weeknum to a value. or am i completely wrong?

[edited by: jatar_k at 6:59 pm (utc) on Nov. 22, 2006]
[edit reason] no urls thanks [/edit]

jatar_k

7:02 pm on Nov 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



so, essentially a drop down that onChange populates a table below it with results

sounds like you have the idea, you could have all the week numbers as the value in each option in your drop down

then have an onChange on your drop down that will submit the form

php can then grab the selected value and use that in the query