The City Guide to hotels, lodges and guesthouses in and around Belfast

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 'PropertyType = 'g' ORDER BY (ISNULL(description) OR (description = '' OR IF(upda' at line 1

SELECT CompanyName,CompanyCode,Address1,Address2,Town,County,PostCode,Telephoneno,Faxno,PropertyType,Stars,Diamonds, Bedrooms,roomsinglerate,roomdoublerate,Golfcourse,Indoorpool,Outdoorpool,Tenniscourts,Gymnasium,Disabled, Amex,AccMaster,Barclvisa,Diners,JCB,switch,delta,Description, handbooktown, paf, SQRT(POW((0-coordx),2)+POW((0-coordy),2)) AS distance, IF(updated < '2003-02-20 00:00:00' OR active = 1,0,1) AS switchoff FROM abcbusiness LEFT JOIN connection ON abcbusiness.CompanyCode = connection.id WHERE PropertyType NOT IN('V','X') AND (webtown = 'Belfast') PropertyType = 'g' ORDER BY (ISNULL(description) OR (description = '' OR IF(updated < '2003-02-20 00:00:00' OR active = 1,0,1))), paf DESC, distance