你好我無法更新我的MySQL表,當我使用如下SQL:問題與更新mysql數據庫列
if(isset($_POST['submitFeedback'])){
$error = array();
$success = array();
$url = $_SERVER['HTTP_REFERER'];
$id = mysql_real_escape_string($_POST['ad_id']);
$email = mysql_real_escape_string($_GET['email']);
$voted = '1';
if(!isset($_POST['userFeedback'])){
$error[] = 'Please select some feedback';
}else{
if(isset($_POST['subComment'])){
$comment = strtolower(mysql_real_escape_string($_POST['userFeedback']));
$subComment = strtolower(mysql_real_escape_string($_POST['subComment']));
$insertIntoBuyerFeedback = mysql_query("UPDATE buyer_feedback SET
seller_vote='$voted', seller_comment='$comment',
seller_sub_comment='$subComment',
WHERE ad_id='$id' AND buyer_email='$email'") or die(mysql_error());
$success[] = 'Thank you for your feedback!';
}
}
}
我從瀏覽器
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 ad_id='5' AND buyer_email='[email protected]'' at line 1
這使得出現以下錯誤對於我來說沒有任何意義,因爲我已經逃脫了有問題的字符串。即使是那些有問題的字符串
多餘的逗號這裏:'... ller_sub_comment = '$ subComment',' –