Derby Artists Posted October 26, 2009 Share Posted October 26, 2009 I have been trying to get my head round database tables and how best to do this......... I am building a dynamic site, and I want part of the site to have a "quicksearch" which consists of 2 dropdown lists. List 1 is all the different counties List 2 is a list of all the different specialities within that area, so for example the user selects Derbyshire from the first drop down box and then chooses, lets for arguments sake say auto repair from the second drop down box, then press the search button. I want the query to obviously only show auto repair in derbyshire and display these to the user. The trouble I am having is getting my head around the databases and how many different tables to run with this. I believe I am thinking to hard and missing an easier way of doing this. If you want an idea of what I am looking for goto http://www.photographers.co.uk/ and then just under the images there is the same sort of thing of what I want in "find a photographer" Like I say I dont need any help with coding, selecting databases etc just stuck in how the databases should be set up because at the minute I keep going down the same road of "oh I will need 00's of tables for this", but surely this is not the case. With thanks folkes Quote Link to comment https://forums.phpfreaks.com/topic/179037-stuck-with-how-to-set-up-database-tables-for-this-project/ Share on other sites More sharing options...
Mchl Posted October 26, 2009 Share Posted October 26, 2009 As far as I can tell you need three tables table counties countyID, name ---------------- 1 , Avon 2 , Bedfordshire 3 , Berkshire etc... table specialities specialtyID, name ------------------- 1 , auto repair 2 , plumber etc.. table companies companyID, countyID, specialityID, name ---------------------------------------- 1 , 1 , 1 , Bob Avon's Auto Repairs 2 , 3 , 2 , Berkshire Plumbers Inc. As you can see in table companies you have columns that indicate in which county and in what speciality given company is. Quote Link to comment https://forums.phpfreaks.com/topic/179037-stuck-with-how-to-set-up-database-tables-for-this-project/#findComment-944612 Share on other sites More sharing options...
Derby Artists Posted October 26, 2009 Author Share Posted October 26, 2009 Cheers for that...see piece of cake when you know. If I get stuck I will give you a shout. Thanks again massive help. Quote Link to comment https://forums.phpfreaks.com/topic/179037-stuck-with-how-to-set-up-database-tables-for-this-project/#findComment-944616 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.