这是我编写的一段 php 代码,我收到一个 HY093 错误,根据我所读到的内容,它要么是绑定错误,要么是关于传递的参数数量或其质量的错误,但我什么也没看到我的代码错了。
当我将某些变量传递给语句时,可能是某些变量为空吗?
$sth = $connection->prepare(
"UPDATE `user_settings`
SET
user_show_money = :user_show_money,
user_show_stats = :user_show_stats,
user_accept_messages = :user_accept_messages,
user_interact_with_activities = ':user_interact_with_activities'
WHERE
user_id = ':user_id'"
);
$sth->execute(
array(
':user_show_money' => $user_show_money,
':user_show_stats' => $user_show_stats,
':user_accept_messages' => $user_accept_messages,
':user_interact_with_activities' => $user_interact_with_activities,
':user_id' => $user_id
));
$sth2 = $connection->prepare(
"UPDATE `users`
SET
user_name = :user_name,
user_avatar = :avatar_path,
user_sex = :user_sex,
user_password = :user_password,
user_quote = :user_quote
WHERE
user_id = :user_id"
);
$sth2->execute(
array(
':user_name' => $user_name,
':avatar_path' => $avatar_path,
':user_password'=> $user_password,
':user_sex' => $user_sex,
':user_quote' => $user_quote,
':user_id' => $user_id
));