我目前收到错误消息
Could not enter data: 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 'order(quantity, product)VALUES ( "number", "text")' at line 1
代码如下:
<?php
require_once('../../config/db.php');
$conn = mysql_connect(DB_HOST, DB_USER, DB_PASS);
if(! $conn )
{
die('Error with database connection: ' . mysql_error());
}
$sql = 'INSERT INTO order'.
'(quantity, product)' .
'VALUES ( "number", "text")';
mysql_select_db('order');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
?>
有人可以让我知道我做错了什么以及如何纠正错误吗?我正在使用 MySQL 5.5.27 和 PHP 5.5。