我是php和sql的新手,但我试图在我的网站上实现这个脚本。无法弄清楚什么是折旧或不正确。提前感谢您的帮助。
$query = "CREATE TABLE `$SET9` (`comment` mediumtext NOT NULL, `time` timestamp(14)
NOTNULL, `image` TEXT NOT NULL default '', `title` varchar(80) NOT NULL default '', `uid`
int(4) NOT NULL auto_increment, `comments` int(11) NOT NULL default '0', `postedBy`
varchar(80) NOT NULL default '', PRIMARY KEY (`uid`))";
$result = @mysql_query ($query);
答案 0 :(得分:1)
CREATE TABLE `$SET9` (`comment` mediumtext NOT NULL, `time` timestamp(14)
NOT NULL, `image` TEXT NOT NULL default '', `title` varchar(80) NOT NULL default '', `uid`
-- ^ put a space here
int(4) NOT NULL auto_increment, `comments` int(11) NOT NULL default '0', `postedBy`
varchar(80) NOT NULL default '', PRIMARY KEY (`uid`))
<强>更新强>
TIMESTAMP
不接受MySQL
中的修饰符。试试这个:
CREATE TABLE `$SET9` (`comment` mediumtext NOT NULL, `time` timestamp
-- ^ nothing here
NOT NULL, `image` TEXT NOT NULL default '', `title` varchar(80) NOT NULL default '', `uid`
int(4) NOT NULL auto_increment, `comments` int(11) NOT NULL default '0', `postedBy`
varchar(80) NOT NULL default '', PRIMARY KEY (`uid`))