I wanna get specific shift time from my database but this scripts return "0 results";
This is my database
id | shift_title | start_time | end_time |
------------------------------------------
1 | shift1 | 00:00 | 08:30 |
2 | shift2 | 08:30 | 12:00 |
3 | shift3 | 12:00 | 19:30 |
4 | shift4 | 19:00 | 00:00 |
and this is my php script
include 'config.php';
$create_time = date('H:i');
$sql = "SELECT * FROM shift_times WHERE start_time <= '$create_time' AND end_time > '$create_time'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["shift_title"];
}
} else {
echo "0 results";
}
$conn->close();