php chained selectors
Posted: Wed May 17, 2006 7:55 am
hey, guys. I have a problem with chained selectors for the web page.
The idea is to make the 3 select boxes that will dynamically populate based on the value of the previous one. The first populates the second and the second populates the third.
I have District, Town/Village and Location. I have found the easy way to do 2, but with three it becomes a little bit messed up and confusing.
I have three tables in my sql, the first table is the District, second is the Town and the third is the Location. The structure of the tables is following:
District
ID
Name
Town
ID
District
Name
Location
ID
District
Town
Location
I was making the query by selecting the location properties with WHERE, then I was making the query with JOIN.
The point was to extract the results of the query into the array, and then use it with javascript, in order to update it dynamically on the page, but I got lost in the syntax, how exactly to declare those arrays and how to pass the values to that arrays.
Thanks to anyone who can help
The idea is to make the 3 select boxes that will dynamically populate based on the value of the previous one. The first populates the second and the second populates the third.
I have District, Town/Village and Location. I have found the easy way to do 2, but with three it becomes a little bit messed up and confusing.
I have three tables in my sql, the first table is the District, second is the Town and the third is the Location. The structure of the tables is following:
District
ID
Name
Town
ID
District
Name
Location
ID
District
Town
Location
I was making the query by selecting the location properties with WHERE, then I was making the query with JOIN.
The point was to extract the results of the query into the array, and then use it with javascript, in order to update it dynamically on the page, but I got lost in the syntax, how exactly to declare those arrays and how to pass the values to that arrays.
Thanks to anyone who can help