Click to See Complete Forum and Search --> : How should I structure this?


Greyfish
02-22-2009, 01:21 AM
Ok, we've all seen the millions of CSS Galleries out there and how they categorize many of the websites by their overall look or purpose (ex: Minimalistic, Colorful, Grungy); so my question is this...what is the best way to organize this?

It may be a simple answer but there are some situations that may cause it to be more complex, for example if a website is categorized in more then 1 category.

pollymac
02-22-2009, 07:01 AM
Category table: category_id, category_desc, etc
Website table: website_id, website_url, website_desc, etc
website_category table: website_id*, category_id*

* asterisks denoting foreign keys to category and website tables

Something like that??

Greyfish
02-22-2009, 03:29 PM
Thankyou for your help pollymac! I didn't even think to do it that way!

Greyfish
02-22-2009, 04:03 PM
I've never really used Foreign Keys before, could you explain to me the advantages of using them? Also I'm not really sure how to use them when it comes time for querying the database.