大家好我写了一个SQL代码,但我想在phpMYadmin上运行它会出错:
SQL
CREATE TABLE IF NOT EXISTS 'urls'(
'url' text NOT NULL,
'code' text NOT NUll,
'ip' text NOT NULL,
'visited' int(11) NOT NULL DEFAULT '0'
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
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 ''urls'( 'url' text NOT NULL, 'code' text NOT NUll, 'ip' text NOT NULL, 'visi' at line 1
答案 0 :(得分:3)
将''
更改为“[回溯您的网址名称]
在phpmyadmin-
测试CREATE TABLE IF NOT EXISTS `url`(
`url` text NOT NULL,
`code` text NOT NUll,
`ip` text NOT NULL,
`visited` int(11) NOT NULL DEFAULT 0
)ENGINE = INNODB DEFAULT charset = utf8;
答案 1 :(得分:0)
试试这个:
CREATE TABLE `urls` (
`url` text NOT NULL,
`code` text NOT NULL,
`ip` text NOT NULL,
`visited` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8