php - need updation for mysql query for choosing date range for reservation of a hotel room or any thing -
There was a situation in my project, which is as follows.
While examining the available rooms
$ sel_from_bookings = "Selection Room" 'From Any Booking' ((''. $ _ POST ['req_tdate'] '' Check_indet And between check_outdate ') or (' ". $ _ POST ['req_fdate']. '' '' $ Sel_from_reserv =" SELECT room_no reservation @ WHERE ('' ('.') During check_indicate and check_out date. '$ _ POST [' REq_tdate '].' 'Between' check_indicate and check_outdate ') or ('. '$ _ POST [' Req_fdate ']. "' Between check_indicate and check_outdate"); $ sel_rooms = "SELECT room_no room" There is no room ("$ Sel_from_bookings.") And room_no IN (". $ Sel_from_reserv.") ";
The first query retrieves the list of room numbers from the booking table, which satisfies the derivatives
Similarly, the table reservation is similar to any other
< P> uses the list given by the above two questions in the last query and receives the list of rooms which are not in the generated list.10-08-2010 / 15-08-2010 Works well for
works fine for 20-08-2010 / 25-08-2010
when If I give dates between 10 and 15, it works fine for 20 and 25 and it works fine for the date of 14-08-2010 and 21-08-2010
But does not work for 16
thanks.
- from room to room_No (check_outadata & amp; ;; @req_fdate and check_indate & lt; = @red_tdate) and no room_from the booking room (SELECT room_no reservation from WHERE check_outdate & gt; = @req_fdate and check_indate & lt; = @red_tdate)
Order Note or arguments: @req_fdate
is the first date here ( to ), @req_t date
is the last date () ).
To check availability for
, use it: from
Select Code> Select- From where in the room there is no room (Check_out date from the booking room & gt; = '2010-08-16' and check_indicate & lt; = '2010-08- 19, / html>
Comments
Post a Comment