Best unofficial Apache Server developers community |
|
Having looked at some of the other mysql availability query questions on here has got me so far, but the way mine works is slightly different to the others. Basically I have a table of dates, and each date is a row. Each row contains fields to say the cost, room type, and how many days your booking has to be to book on that date. So if a Hotel has 1 room type, it will have 365 rows, if it has 5 room types, it will have 1825 rows
I get the from and to dates, and fill in the gap in between so I have all the dates for the booking.
So if the count is the same as the duration, it means all dependencies have been met and it can show the result in the search. I am then passing that query as a variable into another query, that extracts the hotel info, checks to see if the sub query is returning anything or not.
This is fine, however if the sub query returns more than 1 hotel, the main query gives me the error:
I thought because I used 'IN' that it would be ok. Any suggestions? Also when I go about implementing multiple sub queries, the solution will need to work with that too. I am aware that the way I am doing the rooms isnt as elegant as it could be, however I am not sure how else to achieve the results I need, as because the bookings will usually be bulk bookings (eg more than one room booked at a time, if one room type isnt available during the dates provided then the whole hotel needs to be removed from the search results).
posted via StackOverflow
|
![]()  
|
This is the part returning the error. Also, the way you have it, If I understand correctly what you're trying to do, then you should be able to just leave this part out. If Should note as well that
|
|
 
|
The error message is referring to your |