MySQL Alter Table 在已存在的字段之前或之后添加字段
我有这个,但它不起作用:
$query = "ALTER TABLE `".$table_prefix."posts_to_bookmark`
ADD `ping_status` INT( 1 ) NOT NULL BEFORE `onlywire_status`";
我很感激!
我有这个,但它不起作用:
$query = "ALTER TABLE `".$table_prefix."posts_to_bookmark`
ADD `ping_status` INT( 1 ) NOT NULL BEFORE `onlywire_status`";
我很感激!
$query = "ALTER TABLE `" . $table_prefix . "posts_to_bookmark`
ADD COLUMN `ping_status` INT(1) NOT NULL
AFTER `<TABLE COLUMN BEFORE THIS COLUMN>`";
我相信你需要拥有和使用,而不是。ADD COLUMN
AFTER
BEFORE
如果要将列放在表的开头,请使用以下语句:FIRST
$query = "ALTER TABLE `" . $table_prefix . "posts_to_bookmark`
ADD COLUMN `ping_status` INT(1) NOT NULL
FIRST";