How do you do it? I can't seem to find out how to insert a new field into a table that has already been created. (no, not a html table, a mySQL table)
Someone once gave me this help:
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
alter_specification:
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
or ADD [COLUMN] (create_definition, create_definition,...)
or ADD INDEX [index_name] (index_col_name,...)
or ADD PRIMARY KEY (index_col_name,...)
or ADD UNIQUE [index_name] (index_col_name,...)
or ADD FULLTEXT [index_name] (index_col_name,...)
or ADD [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
[reference_definition]
or ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}
or CHANGE [COLUMN] old_col_name create_definition
[FIRST | AFTER column_name]
or MODIFY [COLUMN] create_definition [FIRST | AFTER column_name]
or DROP [COLUMN] col_name
or DROP PRIMARY KEY
or DROP INDEX index_name
or DISABLE KEYS
or ENABLE KEYS
or RENAME [TO] new_tbl_name
or ORDER BY col
or table_options
View more as http://www.usf.uos.de/cgi-bin/info?(mysql)ALTER+TABLE
I thought none of those looks like one that would add a field, but I thought this was the one:
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
Still can't get it, but I'm trying to figure it out.
For example, I want to insert a field called "time" into the table called "replies" and I want it after the field "title". How do I do that? I'm still trying...
Thanks in advanced for any help.