2014-04-19 30 views
-1

我試圖讓這個工作,但我不明白SQL如何在基礎之外工作。你能找到這個錯誤嗎?這個database.sql不能正常工作?

CREATE TABLE lil_urls (
    id varchar(255) NOT NULL default '', 
    url text, 
    date timestamp(14) NOT NULL, 
    PRIMARY KEY (id) 
) TYPE=MyISAM; 

目前我得到這個錯誤在phpMyAdmin:

#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 '(14) NOT NULL, 
    PRIMARY KEY (id)' at line 4 

感謝您的幫助!

回答

0

正確的語法是

CREATE TABLE lil_urls (
    id varchar(255) NOT NULL default '', 
    url text, 
    date timestamp NOT NULL, 
    PRIMARY KEY (id) 
) ENGINE=MyISAM; 

TYPE不再使用,你需要爲ENGINE 使用,沒有必要爲timestamp

指定長度