我有一个面板来确认用户,可以有多个选择选项 select exc。我做了删除用户部分,它的工作很完美,但是更新它们以确认,我有一些问题,我无法更新确认的值,这里是代码:
面板的更新代码:
if(isset($_POST["members"])) {
$members = $_POST["members"];
while(list($index, $member_id) = each($members)) {
confirmMembers($member_id); }
$msg = "Success";}
else { $msg = "Error"; }
确认成员函数:
function confirmMembers($member_id) {
global $db, $log;
try {
$confirm_member = "UPDATE `members` SET `confirmed` = 1 WHERE `member_id` = :member_id LIMIT 1";
$confirm_member_do = $db->prepare($confirm_member);
$confirm_member_do->bindParam(':member_id', $member_id, PDO::PARAM_INT);
$confirm_member_do->execute();
return true;
} catch(PDOException $e) {
$log->logError($e." - ".basename(__FILE__));
return false;
}
}
谢谢