2012-06-13 80 views
2

我有這個查詢,我試圖將它導入到phpmyadmin。你能告訴我如何解決這個問題嗎?謝謝。導入查詢到數據庫的麻煩

DROP TABLE IF EXISTS `dp_confirms`; 
CREATE TABLE `dp_confirms` (
    `id` int(11) NOT NULL auto_increment, 
    `newuser` varchar(32) NOT NULL default '', 
    `newpass` varchar(32) NOT NULL default '', 
    `newquestion` varchar(255) NOT NULL default '', 
    `newanswer` varchar(255) NOT NULL default '', 
    `newmail` varchar(255) NOT NULL default '', 
    `newfname` varchar(32) NOT NULL default '', 
    `newlname` varchar(32) NOT NULL default '', 
    `newcompany` varchar(128) NOT NULL default '', 
    `newregnum` varchar(32) NOT NULL default '', 
    `newdrvnum` varchar(32) NOT NULL default '', 
    `newaddress` varchar(128) NOT NULL default '', 
    `newcity` varchar(64) NOT NULL default '', 
    `newcountry` char(2) NOT NULL default '', 
    `newstate` varchar(32) NOT NULL default '', 
    `newzip` varchar(32) NOT NULL default '', 
    `newphone` varchar(64) NOT NULL default '', 
    `newfax` varchar(64) NOT NULL default '', 
    `sponsor` int(11) NOT NULL default '0', 
    `confirm` varchar(255) NOT NULL default '', 
    `cdate` timestamp(14) NOT NULL, 
    PRIMARY KEY (`id`), 
    UNIQUE KEY `newuser` (`newuser`), 
    KEY `newmail` (`newmail`) 
) ENGINE=MyISAM AUTO_INCREMENT=1 ; 

錯誤,我得到: MySQL表示:

#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`), 
    UNIQUE KEY `newuser` (`newuser`), 
    K' at line 22 
+2

問自己什麼時間戳(14)指。它有效嗎? –

+0

您不能再指定時間戳列的長度。請參閱http://stackoverflow.com/questions/8128330/sql-error-version-5-5-15 –

回答

0

指定的時間戳的長度如timestamp(14)在MySQL 5.1棄用,並且不再從MySQL 5.5支持。

這是很容易固定通過去除長度規格:

`cdate` timestamp NOT NULL,