0

i am using MYSQL as my database.
Due to i have multiple selection of categories one of them is Others
Once the user selected the Others it will shown a textbox which let the user to input a new category.
But now i have problem is how can i add the new column into existing table?

Let's said the existing table is

Cateogry

|Foods|Drinks|Entertaiment|
---------------------------
    <<        DATA        >>

i just want add the new column beside the Entertaiment
New column name : NEWCOLUMN

4
Contributors
4
Replies
15
Views
4 Years
Discussion Span
Last Post by gahhon
0

That's a strange way of going about it, but you'll need to run something like this:

ALTER TABLE Category ADD COLUMN NewColumn VARCHAR(64)
0

Are you going to allow each user to create their own column? If so, this solution is not likely to be scalable. You'd need to consider an Entity–attribute–value (EAV) model for the table, at least for the custom, user specific data.

0

You might want to rethink your database design. A catagory list should be a table lookup, which in turn is referenced in a data table.

You have a database diagram you could show?

0

I am already redesign my database, thus this is no use already.
Thanks for helping. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.