I have a MySQL database that I have created from an Excel spreadsheet. It has two tables. Locations and records Locations has two fields, town and churches. Some towns have more than one church. Records has a four fields, date, type, url...
I have a MySQL database that I have created from an Excel spreadsheet.
It has two tables.
Locations and records
Locations has two fields, town and churches. Some towns have more than one church.
Records has a four fields, date, type, url and church (unique id from locations table)
What I need to get is a web page that initial loads the town into a select box, once the user has selected the town they are then offered a selection box of the churches for that town. Once they select the church a search result will display all the records from the Records table relevant to that church.
I have coded the html page. I have opened the database, I have populated an array with the names of the towns.
Now to the problems, how do I code the select statement to use the php array? Once I have done that how do I then populate the second selection box with the church names. I think that once I have that sorted I might then be able to code the second query on the records table.
Any thoughts or URL's would be most welcome.