Page 1 of 1

Two hotels for the list

Posted: Mon Sep 08, 2008 9:20 am
by php idiot
There are many entries in the 'search' table
Table - 'search'
Table data - holiday details, hotel, price
In the list, I must only have two of the same hotel.
The other search criteria is that the list must be in price order.
If i do the following sql statement
select distinct hotel
from search
and then loop through the hotels and run the next sql statement
select *
from search
where hotel = (above hotelid)
limit 2
I will get 2 entries in the search table for each hotel
the problem is that the list might not be in price order
Does anybody know how to get around this?

Re: Two hotels for the list

Posted: Mon Sep 08, 2008 9:34 am
by jaoudestudios
Use ORDER BY price