任何人都可以弄清楚我在這裏做錯了嗎?該錯誤消息是相當模糊的...MySQL表創建錯誤(語法看起來不錯)
16-Apr-2012 17:36:42] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 24 for query CREATE TABLE wp_psadata(
id INTEGER(10) UNSIGNED AUTO_INCREMENT,
date_entered TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
submitter_name VARCHAR(255),
submitter_email VARCHAR(255),
submitter_phone VARCHAR(255),
event_name VARCHAR(255),
location_name VARCHAR(255),
address VARCHAR(255),
city VARCHAR(255),
state VARCHAR(255),
zipcode VARCHAR(5),
phone VARCHAR(255),
email VARCHAR(255),
uri VARCHAR(255),
event_start_date DATE,
event_start_time TIME,
event_end_date DATE,
event_end_time TIME,
recurs_on_dow TINYINT,
description VARCHAR(4000),
comments VARCHAR(4000),
active TINYINT DEFAULT 1,
wants_reach_at_event TINYINT DEFAULT 0 made by activate_plugin, do_action, call_user_func_array, psa_activate, dbDelta
使用:SQLite的版本,17年2月8日 - 3.7.4/PHP版本5.3.6
謝謝!
編輯:
這是我在PHP中的實際代碼。上面的代碼是從日誌,所以它可能是失去了一些東西:
$sql = 'CREATE TABLE '. $table_name . '(
id INTEGER(10) UNSIGNED AUTO_INCREMENT,
date_entered TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
submitter_name VARCHAR(255),
submitter_email VARCHAR(255),
submitter_phone VARCHAR(255),
event_name VARCHAR(255),
location_name VARCHAR(255),
address VARCHAR(255),
city VARCHAR(255),
state VARCHAR(255),
zipcode VARCHAR(5),
phone VARCHAR(255),
email VARCHAR(255),
uri VARCHAR(255),
event_start_date DATE,
event_start_time TIME,
event_end_date DATE,
event_end_time TIME,
recurs_on_dow TINYINT,
description VARCHAR(4000),
comments VARCHAR(4000),
active TINYINT DEFAULT 1,
wants_reach_at_event TINYINT DEFAULT 0;
PRIMARY KEY (ID))';
看來你沒有用在年底關閉)。 – 2012-04-16 17:49:44
我編輯了我的原始文章以包含實際的代碼。 – Kenny 2012-04-16 18:15:10