Jump to content

How to Recreate Mysql Table Structure Using PHP


HungryMind

Recommended Posts

Hi, I want to re-structure my mysql table.

mysql_query("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT, category_a VARCHAR(30))") or die(mysql_error());

Now! i want to add another fields in this table structure.If admin want to create field category_b and category_c.Should i change table structure and add required fields.Or i should have to redesign database structure.So is it a good way?Like:table: testfields: user_id, categoriesfield values: category afield values: category bfield values: category cI want this type of result.userid: 1, category: auserid: 1, category: buserid: 1, category: cit'll possible in 3 rowsI was trying.userid: 1, category_a: a, category_b: b, category_c: c // It's possible in one rowPlease guide.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...