RE: [PHP-DB] Unlimited Categories
| From: | Luke Woollard | Date: | Tue, 14 Jan 2003 05:52:10 +0000 |
| Subject: | RE: [PHP-DB] Unlimited Categories | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24822@lists.php.net to get a copy of this message | ||
EG:
CREATE TABLE category (
id int not null auto_increment,
parent int default 0,
name varchar 100,
);
The parent field contains the ID of the record of which category it belongs.
Then use a recursive function to display the 'levels' of data. (If parent is
0 then it is top level category)
Luke Woollard
-----Original Message-----
From: Gerard Samuel [mailto:gsam@trini0.org]
Sent: Tuesday, 14 January 2003 4:32 PM
To: php-db
Subject: [PHP-DB] Unlimited Categories
Im figuring this is more of an sql question than anything else.
I'm trying to figure out a table structure to create unlimited depths of
categorical data.
I've done something for category/subcategories before, but haven't an
idea how to create categories at an unlimited depth.
Any pointers would be greatly appreciated.
Thanks
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php