Best practice for PHP/MySQL Appointment/Booking system

后端 未结 2 674
面向向阳花
面向向阳花 2021-02-02 04:58

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

2条回答
  •  情深已故
    2021-02-02 05:10

    Use MySQL keyword 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

提交回复
热议问题