您还需要绑定
couponCode。
if ($couponCode == $coupons_db3['coupon_pre']){ echo $couponCode; $stmt = $db->prepare('UPDATE promopre_3 SET used = 1 WHERe coupon_pre =:couponCode'); $stmt->bindValue(':couponCode', $couponCode, PDO::PARAM_STR); $stmt->execute(); $stmt = $db->prepare('UPDATE usr_customer_profile SET packageid = 3 WHERe usrcustomerid = :usrcustomerid'); $stmt->bindValue(':usrcustomerid', $_SESSION['usrcustomerid'], PDO::PARAM_INT); $stmt->execute(); break; }


