August 6th, 2012, 06:45 AM
Making new categories
I just need idea how to do that.
Let's say I have 3 categories represented by 3 different mysql tables. But I want to add one more category through PHP script.
How to do that, to make one more mysql table
August 6th, 2012, 07:14 AM
Just like you do it in any other case: with a "CREATE TABLE" query.
However, dynamically creating tables normally doesn't make sense. You should rather make a "categories" table and then insert a row for every category.
August 6th, 2012, 08:49 AM
Your underlying design is wrong. You should combine these tables into an entity-attribute-value model with "category" being one of the global attributes.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.