php - SQL syntax; check the manual that corresponds to your MariaDB server version -


i'm getting following sql error:

you have error in sql syntax; check manual corresponds mariadb server version right syntax use near `classxii`.`email`='rajdeep@gmail.com', `classx`.`email`='rajdeep@gmail.com' @ 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'  `graduation`.`email`='$email', `classxii`.`email`='$email', `classx`.`email`='$email'";  $res = mysql_query($sql) or die(mysql_error()); 

what issue here?

you need change commas , in part of statement:

where `graduation`.`email`='$email' , `classxii`.`email`='$email' , `classx`.`email`='$email'"; 

or if searching 1 of them use or:

where `graduation`.`email`='$email' or `classxii`.`email`='$email' or `classx`.`email`='$email'"; 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -