Mysqi STMT错误时更新超过三行


mysqi stmt error when updating more then three rows?

我使用mysqli语句来更新总共15个输入。我用2测试了,它工作了,我用3条记录测试了它,它工作了,所以我说添加更多,然后检查我的工作,我得到这个错误。当我在更新公司名称和名字时我没有得到这个错误

Fatal error: Uncaught exception 'mysqli_sql_exception' with message '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 'WHERE id = ?' at line 1' in /homepages/3/d300203244/htdocs/testphp/updatecustomer.php:23 Stack trace: #0 /homepages/3/d300203244/htdocs/testphp/updatecustomer.php(23): mysqli->prepare('UPDATE customer...') #1 {main} thrown in /homepages/3/d300203244/htdocs/testphp/updatecustomer.php on line 23

我的服务器正在运行php5.4和mysql5.

这是我的代码

<?php
if(isset($_POST['update']))
{mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
require ('dbconnect.php');
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$id= $_POST['id'];
$company= $_POST['company'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$email = $_POST['email'];


$stmt = $con->prepare('UPDATE customer SET company = ?,firstname = ?,lastname = ?,phone = ?, fax = ?,email = ?, WHERE id = ?');
$stmt->bind_param('ssssssi', $company, $firstname, $lastname, $phone, $fax, $email, $id);
$stmt->execute();
echo 'Updated data successfully', PHP_EOL;
echo "Updated data successfully'n";
mysqli_close($conn);
}

WHERE clause

前面有一个额外的逗号
UPDATE ... ,email = ?, WHERE id = ?
                     ^