如果我有一臺這樣:INSERT INTO PHP MyAdmin
CREATE TABLE IF NOT EXISTS users (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
username varchar(255) COLLATE utf8_unicode_ci NOT NULL,
password varchar(255) COLLATE utf8_unicode_ci NOT NULL,
email varchar(255) COLLATE utf8_unicode_ci NOT NULL,
phone varchar(255) COLLATE utf8_unicode_ci NOT NULL,
name varchar(255) COLLATE utf8_unicode_ci NOT NULL,
created_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
updated_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
,我嘗試插入一行到使用phpMyAdmin它:
INSERT INTO users ('john', 'johndoe', '[email protected]' , '123456', 'John', 2013-06-07 08:13:28, 2013-06-07 08:13:28)
那麼爲什麼我得到的錯誤:
#1064 - 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 ''john', 'johndoe', '[email protected]' , '123456', 'John', 2013-06-07 08:13:28, ' at line 1
日期應該與加qoutes「2013年6月7日8時13分28秒」 – Oyeme
什麼上的所有數據? – Rifki