In my SQL Database i have a date column. I want to use a PHP if statement to show some text if the date from the DB equals todays date. Aswell as that, use an else to show something else if the date does not equal today.
Running PHP 7
I have lost count of what i have tried with this but don't seem to get anywhere.
I am fetching the data here:
$sql1 = 'SELECT `date` FROM `operations`.`opsroom` ORDER BY `opsroom`.`date` ASC, `opsroom`.`starttime` ASC LIMIT 1';
$nextsession = mysqli_query($conn, $sql1);
Later on in the file is where i am using this:
<?php
while ($row = mysqli_fetch_assoc($nextsession))
{
if( $row['date'] == DATE(date)){
echo "BOOKINGS TODAY";
} else {
echo "No Bookings";
}
}
?>
Only error i get at the moment is PHP Warning: Use of undefined constant date - assumed 'date' (this will throw an Error in a future version of PHP)