当我尝试运行此声明:CREATE TABLE SQL语句将不会运行
CREATE TABLE 'score_table'
(
'name' text NOT NULL,
'email' text NOT NULL,
'company' text NOT NULL,
'score_total' bigint(11) NOT NULL,
'score_string' longtext NOT NULL,
'id' int(11) NOT NULL auto_increment,
'date' timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY ('id')
)
ENGINE=MYISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
我得到这个错误:
#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 ''score_table'
('name' text NOT NULL, 'email' text NOT NULL, 'company' text NOT N' at line 1
而且我不知道什么是错的,任何帮助将是不胜感激!
你也有你的答案 – Harsh
已经给出了足够的答案,所以我想做一个评论:你真的过度使用引号。除非该名称也可以作为关键字加倍,否则不必使用它们。请参阅:http://sql-info.de/mysql/examples/CREATE-TABLE-examples.html – stackr
哇!感谢所有人的回应!堆栈溢出是国王;) – bbeckford