table reserve
- reserve_id
- roominv_id
- chckin
- chckout
- status (reserved,canceled,pending)
table roominventory
- roominv_id
- room_id
- room_number
- room_status(available , unavailable)
table room
- room_id
- room_type
I'm doing a room reservation system.
I already have the query for the date availability of the rooms :
SELECT r.roominv_id,r.room_id
FROM roominventory r
WHERE r.roominv_id
NOT IN
(SELECT b.roominv_id
FROM reserve b
WHERE NOT (b.chckout < '$chckin'
OR
b.chckin > '$chckout'))
My question is, where will I insert the condition in my query, where I can select a specific room type depends on the room availability.
I know it is like room.room_type LIKE '%$roomtype%'
but I don't know which part of the query I will insert it.