Hello
I hav to do a rental site. And here the user can search for a property where he arrives on adate and will be staying till another date. I want to search the properties available On and in between this dates.
Infact am not sure how to do this. any tutorials are available, to fetch the availabitliy of a property betwen teh dates the user entering and to display?
also how the tables to be designed for the booking and al?
Many Thanks
Sathish
Search in between dates
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Search in between dates
Depending on your database, look into their version of the BETWEEN function.sathumenon wrote:Hello
I hav to do a rental site. And here the user can search for a property where he arrives on adate and will be staying till another date. I want to search the properties available On and in between this dates.
Infact am not sure how to do this. any tutorials are available, to fetch the availabitliy of a property betwen teh dates the user entering and to display?
also how the tables to be designed for the booking and al?
Many Thanks
Sathish
-
sathumenon
- Forum Newbie
- Posts: 5
- Joined: Wed Mar 08, 2006 3:02 am
Helo
Hi
Thanks for replying. Infact I was looking for some tutorials if available. So that I can start my own. I hav created a property table only with the property features. And not sure of how to store the dates of booking.
If a party comes and books for 5 days say from May28th to 1st June. How we can store that in to table for the puspose of searching and finding the available dates for that property?
Thanks
Sathish
Thanks for replying. Infact I was looking for some tutorials if available. So that I can start my own. I hav created a property table only with the property features. And not sure of how to store the dates of booking.
If a party comes and books for 5 days say from May28th to 1st June. How we can store that in to table for the puspose of searching and finding the available dates for that property?
Thanks
Sathish
Maybe not appropriate, but i just helped a friend with his college work.. bookigns for a chruch hall, in that model, we stored bookings in another table.... bookings had [id][userid][start][end][confirmed] - confirmed was just a bool field, confirmed by phone - and id, and userid - easy enough to understand, the start and end were timestamp fields.
In this instance we coded (though i don't have them to hand) a serise of macro type things
I know this is far from a comlpete solution, but i'm just about to go out with the family, when i get back (if someone hasn't beat me to it!) I'll try and protoype the fucntion for you.
In this instance we coded (though i don't have them to hand) a serise of macro type things
Code: Select all
IsAvailable($property_id, $from_stamp, $to_stamp)-
sathumenon
- Forum Newbie
- Posts: 5
- Joined: Wed Mar 08, 2006 3:02 am
Will try this
Hello
Thanks a lot for the idea. Infact I designed a table similar to this, with Date Id, Property Id, Arrival Date, Departure Date.
I think this might work! Let me try!!!!
Thanks again
Sathish
Thanks a lot for the idea. Infact I designed a table similar to this, with Date Id, Property Id, Arrival Date, Departure Date.
I think this might work! Let me try!!!!
Thanks again
Sathish