MySQL Update:数据库查询中的意外输入字段参数

时间:2014-01-16 22:42:48

标签: php mysql whmcs

这段代码怎么了?

$SQL1 = "UPDATE table SET status='".$status."' WHERE email='".$client['email']."'";

我收到错误:数据库查询中出现意外的输入字段参数。

这是完整的代码

$server1 = "localhost";
$user_name1 = "DBUSER";
$passworda2 = "2HGfn5D480#";
$database2 = "DBNAME";
$db_handle1 = mysql_connect($server1, $user_name1, $passworda2);
$db_found = mysql_select_db($database2, $db_handle1);
if ($db_found) {
$status = "6";

$SQL1 = "UPDATE table SET status=".$status." WHERE email='".$client['email']."'";

$result = mysql_query($SQL1);
mysql_close($db_handle1);
}
else {
print "Database NOT Found ";
mysql_close($db_handle1);
}

1 个答案:

答案 0 :(得分:0)

似乎错误的原因是

mysql_close($db_handle1);

花了我4个小时来弄明白! :d