dimanche 12 août 2018

Get value from select in pdo mysql for if statement

I need to get select value from select query in pdo and get that select value for if statemnt. this code i try before but still show alert when balance higher .

$q=$this->db->query(" SELECT value FROM transaction WHERE id='1'");
if ($_SESSION['value'] < $q){

echo"<script>window.location.href='index.php?page=orders';
alert('your value to low');</script>";}

Aucun commentaire:

Enregistrer un commentaire