Logop��die

SELECT adresseintraege_neu.ID AS Eintrag_ID, adresseintraege_neu.*, Adressen.* FROM adresseintraege_neu INNER JOIN Adressen ON adresseintraege_neu.Adress_ID = Adressen.ID WHERE Adressen.Geprueft=1 AND adresseintraege_neu.BereichID = ORDER BY IF(adresseintraege_neu.Eintragart = 3, adresseintraege_neu.Eintragart, 1) DESC, IF(adresseintraege_neu.Eintragart = 2, adresseintraege_neu.Eintragart, 1) DESC, IF(Adressen.Ort='Ulm',0,1), IF(Adressen.Ort='Neu-Ulm',0,1), IF(LENGTH(Adressen.Name_2) > 1, Adressen.Name_2, Adressen.Firma) ASCYou 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 IF(adresseintraege_neu.Eintragart = 3, adresseintraege_neu.Eintragart, ' at line 1