-1
我已经编写了一些SQL并运行它来查找实际上所有表中的错误。这是我已经得到了表中的误差:使用UniServerZ的MySQL语法错误
Error creating table 'Region': 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
'desc varchar(25) NOT NULL, PRIMARY KEY(regID))' at line 1
我的代码:
mysql_select_db($dbName, $dbConnection);
$sql = "CREATE TABLE ".$dbTableRegion." (regID int(4) auto_increment NOT NULL, desc varchar(25) NOT NULL, PRIMARY KEY(regID))";
if(mysql_query($sql, $dbConnection))
{
echo("Table '".$dbTableRegion."' created<br />");
}
else
{
echo("Error creating table '".$dbTableRegion."': ".mysql_error()."<br />");
}
你可以用'附上desc。它是mysql中的系统字 – bksi 2014-11-06 00:32:50