Answer the question
In order to leave comments, you need to log in
Why is the WHERE condition not met?
if ($promo == 'NEWUSER'){
if($bd->Query("SELECT COUNT(*) FROM users_nykfageubf WHERE p = '$p' AND promo_new=1")){
$bd->Query("UPDATE users_nykfageubf SET promo_new = 0 WHERE p = '$p'");
$bd->Query("UPDATE users_nykfageubf SET balance=balance+10 WHERE p = '$p");
} else {
echo '<div class="alert-msg"><a href="#" class="close-alert"><i class="fa fa-times"></i></a><p>Вы уже использовали промокод.</p></div>';
}
}
Answer the question
In order to leave comments, you need to log in
because
$bd->Query("SELECT COUNT(*) FROM users_nykfageubf WHERE p = '$p' AND promo_new=1"))
$bd->Query("UPDATE users_nykfageubf SET balance=balance+10, promo_new = 0 WHERE p = '$p' AND promo_new=1");
$stmt = $bd->Query("SELECT 1 FROM users_nykfageubf WHERE p = '$p' AND promo_new=1 LIMIT 1");
if ($stmt->rowCount() > 0) {
...........
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question