Subcategories in php
| From: | phpu | Date: | Sat, 20 Sep 2003 14:40:47 +0000 |
| Subject: | Subcategories in php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-163292@lists.php.net to get a copy of this message | ||
Hi,
I have been trying to do this for weeks but i just cant figure this out. I have categories that have
subcategories and i want to insert them into database. My table looks like this: cat_id, parent_id
and cat_name.
Let's say i wanna insert a subcategory that is associated with its parent category.
For example
ParentCat 1
ParentCat 1 > ItsSubCat 1
ParentCat 1 > ItsSubCat 2
ParentCat 1 > ItsSubCat 3
ParentCat 1 > ItsSubCat 4
ParentCat 2
ParentCat 2 > ItsSubCat 1
and so on ...
I don't know how to create the script that inserts any subcategory(in this case let's say
ItsSubCat 3) in its parent category.
Please, can someone help me
thanks