-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 –