【发布时间】:2011-06-03 03:05:48
【问题描述】:
我的文件中有以下几行 PHP 代码以及一些其他代码:
$command = "INSERT INTO inventory_items (Index, Name, Price) VALUES (NULL, 'Diamond', '3.99')";
$insertion = mysql_query($command) or die(mysql_error());
if ($insertion == FALSE)
{
echo "Error: Insert failed.";
}
else
{
echo "Insert successful.";
}
它一直返回这个错误:
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 'Index, Name, Price) VALUES (NULL, 'Diamond', '3.99')' at line 1
myAdmin 说我使用的是 MySQL 客户端版本 5.0.91。我究竟做错了什么?我就是想不通!我尝试了很多搜索...
【问题讨论】:
-
这里的答案是否解决了您的问题?
标签: php mysql sql phpmyadmin