I need my booking system to display bookings in order from the earliest time. So if someone booked an equipment from 12:00 to 2:00, then the next person to use the system books the same equipment on the same day from 10:00 to 11:00. Following this a third person books the same equipment on the same day from 11.00 to 12.00.
The booking system works fine, but displays it in the order of bookings. So with the above example, the starting times would show up as:
-12.00 -10.00 -11.00
What I would like to do is display the starting times in order of earliest. So the above example would be displayed as following:
-10.00 -11.00 -12.00
$sqlEvent="select * from bookings where selected_date='".$month."/".$day."/".$year."'";
$resultEvents=mysqli_query($dbconnection,$sqlEvent);
echo "<br>";
while($events=mysqli_fetch_array($resultEvents)){
echo "<span class='one'><span class='oneagain'>Equipment:</span> ".htmlspecialchars($events['equipment'])."</span><br>";
echo "<span class='two'><span class='twoagain'>Start Time:</span> ".htmlspecialchars($events['start_time'])."</span><br>";
echo "<span class='three'><span class='threeagain'>End Time:</span> ".htmlspecialchars($events['end_time'])."</span><br>";
}
}
I tried the following, but nothing worked:
$sqlEvent="select * from bookings ORDER BY start_time ASC where selected_date='".$month."/".$day."/".$year."'";