Page 1 of 1

Adding a new field to the end of a table - mysql

Posted: Sat May 20, 2006 6:18 pm
by watson516
how does one go about adding a new field to the end of a mysql table via php?

Posted: Sat May 20, 2006 6:20 pm
by RobertGonzalez
I believe it will involve the SQL command ALTER TABLE. Beyond that, I'm not sure. Do you have phpMyAdmin? If so, use their utility to add a field to the table and copy the generated SQL command. :wink:

Posted: Sat May 20, 2006 6:47 pm
by watson516
fantastic

$sql = 'ALTER TABLE `cbox` ADD `c_cat6` INT NOT NULL;';