-1
我得到下面的SQL錯誤的手冊:SQL語法;檢查對應於您MariaDB的服務器版本
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near
`classxii`.`email`='[email protected]', `classx`.`email`='[email protected]'
at line 5
我的PHP代碼如下所示:
$sql = "UPDATE `graduation`, `classxii`, `classx` SET `university`='$university', `college`='$college', `course`='$course', `branch`='$branch', `year`='$year',
`school1`='$school1', `board1`='$board1', `percentage1`='$percentage1', `year1`='$year1',
`school2`='$school2', `board2`='$board2', `percentage2`='$percentage2', `year2`='$year2'
WHERE `graduation`.`email`='$email', `classxii`.`email`='$email', `classx`.`email`='$email'";
$res = mysql_query($sql) or die(mysql_error());
可能是什麼問題嗎?
多'使用WHERE'條件相結合AND/OR,而不僅僅是逗號分隔的條件列表 –
現在停止使用舊的不推薦使用的mysql擴展;並用準備好的語句和綁定變量切換到mysqli或pdo –