|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Table Design Question?
I have seen more than one tutorial on making a Yahoo type link directory and basic search engine but I cant find anything like the website I'm trying to build.
I just want to display Categories (for site navigation) on every page, then Sub Categories, then listings, and finally Detailed listings. An example site is found here Http://www.daytondepot.com Check out the progression of links by visiting Accommodations then Hotels, then the hotel list and the go to Best Western where you will see a Detailed listing called More info. This is what I am trying to accomplish. I made a table layout in MySQL with a lookup table and reference keys in some of the tables. I can make a basic round trip through the categories but sometimes the wrong listings show up under the wrong sub-categories. I am not sure if it is my Table layout or my queries and PHP progamming? If anyone has a nice database structure for something like this I would be soooo greatful! Most likely looking at the database setup and php programing I have done will be more trouble than just suggesting a good layout but I'm certainly willing to get more information to anyone who wants it. Thanks Sean Karns |
|
#2
|
||||
|
||||
|
I would use one table to handle the categories, and use a parent/child type setup. e.g.
Cats Table catid INT PK desc VARCHAR parentid INT In the table above, parentid references catid. Then, I'd have a Hotels table (or whatver it is that are the listings)... that table should be simple. The foreign key would be catid. |
|
#3
|
|||
|
|||
|
Thanks!
stumpy,
Thanks for the table layout suggestion. I will see what I can do with it. I think I see where you are going, though I am a newbie at this Thanks alot for the reply to my question. Sean Karns PS If I can figure out how to set it all up and it works I will post about it. Thanks |
|
#4
|
||||
|
||||
|
I build most large site using the tree structure setup. All the nav is contained in the one table, as outlined above. Examples:
http://www.ingrealestate.com.au/investment/ http://www.ingrealestate.com.au/development/ http://www.gbcaus.org/ http://www.gbcaus.org/greenstar/ |
|
#5
|
|||
|
|||
|
Example Sites
stumpy,
Thanks for the example sites. Those are some very nice websites indeed. I see the structure, it makes sense and I like it very much. Thanks for the help Sean Karns |
|
#6
|
||||
|
||||
|
Excellent - no problem
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Table Design Question? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|