Jump to content

ALTER SYNTAX


jenniferG

Recommended Posts

The correct syntax is:

 

ALTER TABLE `tablename` CHANGE `fieldname` `newfieldname` FIELD TYPE DEFAULT 'Default value'

 

For example, to set the default on an int field back to 0, you might do something like:

 

ALTER TABLE `ratings` CHANGE `timestamp` `timestamp` INT( 50 ) NOT NULL DEFAULT '0'

 

p.s. Please don't type in capitals. It's incredibly annoying.

Link to comment
https://forums.phpfreaks.com/topic/68601-alter-syntax/#findComment-344919
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.