This article explains four methods for doing this:

http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17
/4047/index.html



-----Original Message-----
From: phpu [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 20, 2003 7:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Subcategories in php

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

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

Reply via email to