SQL problem: SELECT contributi.id,contributi.filename,contributi.coinid,contributi.contributore,contributi.origine,contributi.contrdescr, node.coiner,node.id as coinerid,node.coiner,node.realcoiner,node.maintitle,node.descr,moneta.id AS monetaid,contributi.dritto, globalmoneta.globid,provenienzaesemplare,assiesemplare,pesoesemplare,mindiametroesemplare,maxdiametroesemplare,superscript,hidden, nome,pasv.link FROM (coiner AS node,contributi,globalmoneta,moneta) LEFT JOIN pasv ON label=origine WHERE globalmoneta.parentid=node.id AND moneta.globid=globalmoneta.globid AND contributi.coinid=moneta.id AND (contributi.dritto="D" OR contributi.dritto="R" OR contributi.dritto="B") AND node.lft BETWEEN AND AND contributi.coinid LIKE CONCAT(node.id,"/%") ORDER BY node.lft DESC,globalmoneta.ordine,contributi.dritto DESC LIMIT 100000 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 'AND AND contributi.coinid LIKE CONCAT(node.id,"/%") ORDER BY node.lft...' at line 11