Page 1 of 1
Search in between dates
Posted: Sat May 27, 2006 6:42 am
by sathumenon
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
Posted: Sat May 27, 2006 12:47 pm
by twigletmac
How are you storing the dates? Do you have any code started?
Mac
Re: Search in between dates
Posted: Sat May 27, 2006 12:51 pm
by RobertGonzalez
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
Depending on your database, look into their version of the BETWEEN function.
Helo
Posted: Sat May 27, 2006 10:58 pm
by sathumenon
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
Posted: Sun May 28, 2006 6:09 am
by Soogn
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
Code: Select all
IsAvailable($property_id, $from_stamp, $to_stamp)
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.
Will try this
Posted: Sun May 28, 2006 11:49 am
by sathumenon
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