Link to home
Start Free TrialLog in
Avatar of David Schure
David Schure

asked on

Query on Todays Date and Status

Trying to run a query on todays date.
SELECT 
    COUNT(*)
FROM
    tbl_session
      WHERE session_date = today()
      AND session_status=Booked;

Open in new window

This is what I am getting back
User generated image
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

What database are you using MySQL?
ASKER CERTIFIED SOLUTION
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or use the php equivalent to inject the value into the query....

You can use $date
$date = date('Y-m-d')
Avatar of David Schure
David Schure

ASKER

Thank you CURDATE() worked.  Now it's complaining about the Booked part.
Got it thank you!
SELECT 
    COUNT(*)
FROM
    tbl_session
      WHERE
      session_date=CURDATE()
      AND
      session_status="Booked";

Open in new window