我遇到了致命错误,该错误使用PDO更新了数据:
Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
检查我的代码。致命错误:未捕获的PDOException:SQLSTATE [HY093]:无效的参数编号:绑定变量的数量与标记的数量不匹配
$sql = "UPDATE registration SET
first_name=:first_name,email:email, password=:password, dob=:dob,country:country,gender:gender,meal:meal,profile_pic:profile_pic,resume:resume WHERE id='".$id."'";
$s = $connect->prepare($sql);
// 4. NOW, you can bind values...
$s -> bindValue(':first_name', $user_name);
$s -> bindValue(':email', $user_email);
$s -> bindValue(':password', $password);
$s -> bindValue(':dob', $dob);
$s -> bindValue(':country', $country);
$s -> bindValue(':gender', $gender);
$s -> bindValue(':meal', $chk);
$s -> bindValue(':profile_pic', $image);
$s -> bindValue(':resume', $docName);