Just having a bit of a problem that i can't for the life of me get my head around, i know it can't be overly complicated but if anyone can give me a hand i would most appreciate it!
Quick overview of the setup:
table - event
this returns a list of room ids that:
1) have the correct capacity
2) handles the type of event
Then the code needs to check if the room is available. This information
is stored in
table - diary
two columns in this table are called 'start_date' and 'end_date'
the dates are stored in unix timestamp format
this query in itself returns the correct data, it will return
a row if a particular booking is on or inbetween the dates stored.
The problem i am having, how do i get it to return a list that:
1) displays rooms that are available
2) displays rooms that are unavailable
Any help is greatly appreciated!
Thanks.
Quick overview of the setup:
table - event
Code:
SELECT * from event WHERE event_type='$_POST[frmType]' AND event_max >='$_POST[frmDelegates]'
this returns a list of room ids that:
1) have the correct capacity
2) handles the type of event
Then the code needs to check if the room is available. This information
is stored in
table - diary
two columns in this table are called 'start_date' and 'end_date'
the dates are stored in unix timestamp format
Code:
SELECT * FROM diary WHERE (start_date >= '$begin' AND start_date <= '$end')
OR (end_date <= '$end' AND end_date >= '$begin') ORDER BY venue_id ASC
this query in itself returns the correct data, it will return
a row if a particular booking is on or inbetween the dates stored.
The problem i am having, how do i get it to return a list that:
1) displays rooms that are available
2) displays rooms that are unavailable
Any help is greatly appreciated!
Thanks.