I need some people to battle a \"best practice\" for a PHP/MySQL appointment system for a hairdresser I\'m currently working on. Hopefully, together we can clear some things up
Use MySQL keyword BETWEEN.
BETWEEN
SELECT * FROM mytable WHERE mydate BETWEEN start_date AND end_date;
If you want to see if an appointment is available between now and a day, you could do this:
$enddate = strtotime('+1 day', time()); SELECT * FROM mytable WHERE mydate BETWEEN NOW() AND {$enddate};
Source