Re: Complex select query
- From: "Pankaj" <panahuja@xxxxxxxxx>
- Date: 26 Oct 2006 05:55:23 -0700
between would fetch me all records in the given range. It would not
distinguish if the value of the field is 0 or 1 (available or booked)
I don't s'pose this is really a php issue, it'll depend on what database
you're using. Presumably whatever that is it'll give you a way to effect
"between", because you want to find any existing bookings *between* the
start and the end date that your prospect is trying to book.
It may be doable in a single query. It might depend on your table
structure of course.
Something like :- (serving suggestion)
SELECT * FROM Bookings WHERE BETWEEN(BookingDate, NewStart, NewFinish)
AND Room=theRoom;
Regards
Mark
.
- Follow-Ups:
- Re: Complex select query
- From: Steve
- Re: Complex select query
- References:
- Complex select query
- From: Pankaj
- Re: Complex select query
- From: Usenet
- Complex select query
- Prev by Date: Re: Diary Script
- Next by Date: Re: non session/cookie login
- Previous by thread: Re: Complex select query
- Next by thread: Re: Complex select query
- Index(es):