July 15, 200818 yr hi , I'm New on php , I want design a online sale for laptop , accessories and gaming console ok ? each of parent categories has a child for example : laptop >dell >sony >etc . and i also design the database nicely . you can see ERD herehttp://zarrinweb.com/htgroup/HT-group.png 1 - Let Me Know if my database design is normal and ok ? if not what's the problem . 2 - after define the category and also subcategory 2-1 : How can i determine it's Parent Category or child ? 2-2 : How Can I show that to user ? and after click on each parent categories Then Show childs . (like OSC ) Tanks For Helping .
July 16, 200818 yr your database design is not good. if you want to have a parent->child relationship with the categories, you need to add a "ParentID" field, which contains the CatID of it's parent, or 0 for a top-level category.
July 16, 200818 yr Author ok , i have fix the database by adding one row to category table (parent_cat_id). now , i must show to admin a form to fill category table but how can i understand the admin add a category or subcategory ? and after that how can i retrieve this information from database and show the user as a category ?
Create an account or sign in to comment