当我尝试运行此语句时:
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 ;
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
#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
Run Code Online (Sandbox Code Playgroud)
我不知道什么是错的,任何帮助都将不胜感激!
表和字段名称需要用反引号而不是单引号(或根本没有引号):
CREATE TABLE `score_table`.....
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
372 次 |
| 最近记录: |