Is it possible to insert columns into a MySQL table??
I've created a table and named it "my_table" - I do not understand, why MySQL does not eats my syntax...
INSERT INTO "my_table"(
"item" char(1) NOT NULL DEFAULT '',
"price" int(10) NOT NULL DEFAULT '3000',
"level" int(10) NOT NULL DEFAULT '1000',
"super" char(1) NOT NULL DEFAULT '',
"play" char(1) NOT NULL DEFAULT ''
)
Error message:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"my_table"( "item" char(1) NOT NULL DEFAULT '', "price" i' at line 1
So what's wrong with my syntax ?
If you're trying to add columns to an already created table you must use ALTER.
ALTER TABLE my_table ADD item char(1) NOT NULL DEFAULT '';
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html http://www.techiecorner.com/560/mysql-how-to-add-column-to-existing-table/