I have a list of rooms
- Deluxe
- Standard
- Regular
I made a display records based on what the user added per day.
If the user add a new event and use one of the room.
Example: for this day August 26,2018. one event was booked, and it will display the ff. Retrieved from database.
Deluxe - 1 booked
What I want to display is this:
Deluxe - 1 booked
Standard - none
Regular - none
I want to add all the list of rooms even some of the rooms has no value in database or doesn't exist in database.
But how can I do it? Please help!
My sample code:
$connect = mysqli_connect("localhost", "root", "", "bookings");
$sql = "SELECT * FROM events WHERE (start BETWEEN '$start' AND '$end' OR
end BETWEEN '$start' AND '$end');
$result = mysqli_query($connect, $sql);
while($rows = mysqli_fetch_array($result))
{
echo $rows['room'];
}