PDA

Click to See Complete Forum and Search --> : PHP myadmin


cinr11
Sep 1st, 2008, 06:55 PM
Hello Everyone,


I'm using php myadmin through my web hosting company and I'm trying to build a ecommerce site but am getting confused. This is my site www.smallfavors4u.c.com. Under Theme favors under the left panel is one category. Then when you click on vegas you have anther category. With that you have all the information for the table . I have this sooo far but am thinking im doing it wrong. What do you think? What would product id be then?
Thank in advance

Field Type Collation Attributes Null Default Extra Action
Product ID varchar(250) latin1_swedish_ci No
Name varchar(250) latin1_swedish_ci No
Description text latin1_swedish_ci No
Price decimal(65,0) No
Picture longblob BINARY No
Available varchar(10) latin1_swedish_ci No Check All / Uncheck All With selected:

visualAd
Sep 2nd, 2008, 05:07 AM
I don't think the way you have done it is wrong, but the way you have done is does not make it scalable and you are likely to run into problems if the system needs expanding. I.e: products in more than one category; changing the products category.

I suggest you make a new table called categories and give each category a name and an ID and indicate weather a category is a sub category of another category. You can then add a field to your products table called category ID.

# categories
category_id INTEGER
category_name VARCHAR(50)
parent_id INTEGER DEFAULT 0