这是它返回的错误:
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 '() )' at line 1
我如何解决它,这非常烦人。我是一个编程MySQL和PHP的菜鸟。所以任何帮助将不胜感激。
这是我的代码:
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = 'INSERT INTO users '.
'(ID,Points) '.
'VALUES ( "2222", "999"() )';
mysql_select_db('database1');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
?>
提前致谢。
编辑:Sry提出这个问题,如果可以,会删除它。
答案 0 :(得分:3)
$sql = 'INSERT INTO users '.
'(ID,Points) '.
'VALUES ( "2222", "999"() )';
^^^^
HERE
删除它们。