Search Posts

Author: Isaiah

How can I put sql count value on a variable?

I construct a code wherein it will count records where reservation_status = ‘WAITING’. If the total number of waiting is >= 1, then it will show the records and perform the claiming of reservations. Else it will echo “The Unclaimed Reservations List is Empty”. This is my code: <?php $countsql = mysqli_query($conn,”SELECT count(*) FROM reservations WHERE reservation_status = ‘WAITING’;”); $count = mysqli_num_rows($countsql); if ($count >= 1){ $select = mysqli_query($conn,”SELECT * FROM reservations WHERE reservation_status = […]