hi all,
my form consists of selecting "from time" and "to time" to select room booking.
my database also consists of two field which is are also from time and to time.
the problem is i want to display records that the period time that the user has selected is already exist in the database,
for example, the user wants to book room from 9 am to 10 am, so the from_time will be 9 am and the to_date will be 10 am.
if the records in the database, where by the room has been booked from 8 am to 10 am, which from_time is 8 am and to_time is 10 am,it will display record for this to indicate that the user that the room has been booked for that time period she has selected.
how to write the sql coding?
select * from roomHotel
where from_time (???)
and to_time (???)
my form consists of selecting "from time" and "to time" to select room booking.
my database also consists of two field which is are also from time and to time.
the problem is i want to display records that the period time that the user has selected is already exist in the database,
for example, the user wants to book room from 9 am to 10 am, so the from_time will be 9 am and the to_date will be 10 am.
if the records in the database, where by the room has been booked from 8 am to 10 am, which from_time is 8 am and to_time is 10 am,it will display record for this to indicate that the user that the room has been booked for that time period she has selected.
how to write the sql coding?
select * from roomHotel
where from_time (???)
and to_time (???)