Ein Datenbankfehler ist aufgetreten

Error Number: 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 priority' at line 1

SELECT *, 1+((id+hotel_id) % 4) AS mod_4 FROM charmio_images WHERE NOT medium='' AND hotel_id= ORDER BY priority