Hi,

I'm trying to build a new db for a website and I've got an idea on how it should work but I can't seem to figure out what the best way would be if it comes to the design of the tables in the db.
Maybe I'm just looking at the the wrong way...


I would like to make the website completely db driven but path based.
TO get rid of the ugly uri's like index.php?pad=blaat&naar=sjips&bestand=opti I would like to use mod_rewrite so the same page can be accessed using www.domain.nl/blaat/sjips/opti. This part isn't realy a problem.


The problem is how should this be implemented in the db?
In the db the different levels have to be known so "sjips" is a subcategory of "blaat" and "opti" is a subcategory of "sjips" agian.
In the db the name of each category and page has to be stored.
This has the be easily extendable because at first there might not be a subcategory of a subcategory. Imo there shouldn't be a different column or table for each category to list it's subs, am I right?
What I could be is created a table with e.g. 3 columns, one containing an unique id for each category and page, one containing each unique name of that category of page and one column containing the id of its parent.
I'm not sure if this would be a good thing to do from a coding point of view because you have to contact the db multiple times to get all the information about on specific category or page, wouldn't you?


It look like a simple concept imo but it might be the lack of sleep not getting me think strait anymore...
Am I overlooking something?
Am I creating problems which aren't there?


Cheers,

Age

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to