The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
The structure works as follows:
Continent
Country
Region
Area
I have 4 tables - one each for the 4 levels of location above.
Now if someone searches for a villa in a given area, easy - a simple query to find the matching records.
My question is, if someone specifies, say, a region but no area, what's the best way of finding the results? Use a JOIN query to pull the region ID into each row of the villas table? Or is there a more efficient way to do it?
Next question...
If somebody wants to pick an area, I want it to only show areas for a the chosen region, and only show the regions for the chosen country, and only show countries for the chosen continent.
I want it to be a series of dropdown boxes that are dynamically filled with values once the previous box has been chosen.
Now on some sites, these work by having a JavaScript array with all the data in, and some refresh the page. I'm thinking a page refresh would be a good idea, since potentially there will be a lot of values.
Unfortunately, I'm not that good with JavaScript - but I am prepared to learn. I've Googled a bit, and had a look at a few sites, but I'm struggling to find any help on the page refresh method. Before I dissect a web page to find out how they do it, can they please give me some links, or general tips.
Cheers.
EDIT: OK, that was much easier than I expected - I guessed and it worked!
The structure works as follows:
Continent
Country
Region
Area
I have 4 tables - one each for the 4 levels of location above.
Now if someone searches for a villa in a given area, easy - a simple query to find the matching records.
My question is, if someone specifies, say, a region but no area, what's the best way of finding the results? Use a JOIN query to pull the region ID into each row of the villas table? Or is there a more efficient way to do it?