EROARE SQL:

SELECT
      count(distinct of.id) AS nr
FROM
      oferte_sejur AS of, tari, localitati AS l, cazari AS c, clasificari AS stele, clasificari AS masa, agentii, clasificari AS transp
WHERE
      of.idtara=tari.id AND
l.id=of.idlocalitate AND
agentii.iduser=of.iduser AND
c.id=of.idhotel AND
stele.id=c.clasificare AND
masa.id=of.idmasa AND
of.expira>='2013-08-26' AND
transp.id=of.idtransport AND
of.iduser='123' AND
of.nume like '%oferta%speciala%cipru%' AND
of.idtara='9' AND
of.idlocalitate='503' an ) /* end_teme */
ORDER BY (of.`pretdoubleminim`/if(of.moneda='ron',4.2,if(of.moneda='usd',1.23,1))) ASC , stele.nume desc, of.datamodificare desc, of.id desc

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 'an ) /* END_TEME */ ORDER BY (of.`PretDoubleMinim`/IF(of.Moneda='RON',4.2,IF(o' at line 17