2012-03-17 93 views
1
CREATE TABLE 'serverlist' (
'ID' int(4) NOT NULL auto_increment, 
'Name' text NOT NULL, 
'Number' text NOT NULL, 
'BuyIn' DOUBLE NOT NULL default'0', 
'BuyIn2' DOUBLE NOT NULL default'0', 
'Limit' int(5) NOT NULL default'0', 
'AvgPot' DOUBLE NOT NULL default'0', 
PRIMARY KEY (id) 
); 

^這將導致以下錯誤:MySQL的 - phpMyAdmin的 - 錯誤#1064

#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 ''serverlist' ('ID' int(4) NOT NULL auto_increment, 'Name' text NOT NULL, 'Nu' at line 1

任何想法?

回答

3

改變簡單的報價由反引號:

CREATE TABLE `serverlist` (
`ID` int(4) NOT NULL auto_in 
... 
+0

有這個之間的差異,並沒有任何的報價呢? – joakimdahlstrom 2012-03-17 16:32:45

+2

用引號可以使用表格和字段名稱中的空格以及保留字作爲標識符。 – danihp 2012-03-17 16:33:48