secluded, country,cottages,uk

select SQL_CALC_FOUND_ROWS cott.*, own.phone, own.btel, own.bmobile, own.mobile, ctry.countryname, cty.countyname, cty.extra3, 'paid' as type, cott.NoBedrooms, cott.bathroom, cott.SleepsT, cott.SleepsF, cott.PriceFrom, cott.PriceTo, cott.rating, cott.Dogs, cott.CottTown from cottages as cott left join country as ctry on cott.CottCountry = ctry.countryid left join county as cty on cott.CottCounty = cty.countyid left join owners as own on cott.ownerid = own.ownerid left join tg_views as v on v.id=cott.cottageId left join cottages_geo as geo on geo.id=cott.cottageId where (cott.CottCountry = '$countryid' AND ) order by v.views asc limit 0, 10 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') order by v.views asc limit 0, 10' at line 10