I'm fairly new to MYSQL and PHP, and i'm working on a project for a security department. The guards work in 2 teams of 12 hour. (7am - 7pm and 7pm - 7am). They log events that happened during their shift to a database, and now i would like to be able to select only the data from each shift.
I use this for the 7AM - 7PM:
$sql = "SELECT * FROM table WHERE date >'".date("Y-m-d 07:00:00")."' AND date <'".date("Y-m-d 19:00:00")."'";
but I don't seem to be able to find out how I can do the same for the 7pm (previous day) to 7 am.
Most answers I find tell me how to select previous day, but none tells for a specific time during that day.