June 22nd, 2000, 10:13 AM
I just made a table using "CREATE TABLE asdf (...);", and I forgot to specify the primary key. Also, how do I ADD/DELETE more columns? Thanks..
June 22nd, 2000, 10:57 AM
You need to use the 'ALTER TABLE' statement.
To change a coloumn it's;
ALTER TABLE tablename MODIFY columnname column properties
ALTER TABLE user MODIFY id INT(11) PRIMARY KEY;
To add a column use ADD;
ALTER TABLE user ADD password VARCHAR(15) ...etc.
June 22nd, 2000, 11:04 AM
OK, thanks. All the tutorials I found only told you how to CREATE, but not EDIT.. Now I suppose that to delete a column (for future reference) I use "ALTER TABLE tablename DELETE columnname"?
June 22nd, 2000, 11:17 AM
ALTER TABLE tablename DROP columnname;