Could not successfully run query (select * from `titoli` where `id_editore`=1 and `online`=1 and (id=) order by (case when ordinamento is null then 99999999 else ordinamento end), titolo, sottotitolo ) from DB: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') order by (case when ordinamento is null then 99999999 else ordinamento end), t' at line 1