2017-04-06 11:08

SQL语法; 检查与MariaDB服务器版本对应的手册[关闭]

  • php
  • mysql

I'm getting the following SQL error:

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`='', `classx`.`email`='' at line 5

My PHP code looks like:

$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());

What could be the issue here?

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享