select a.arbre_id from phantom_content c1 inner join phantom_contenu c on c1.contenu_id=c.contenu_id inner join phantom_arbre a on ((c.arbre_id=a.arbre_id and a.arbre_id_alias is null) or (c.arbre_id=a.arbre_id_alias and a.arbre_id_alias is not null)) and c.langue_id=1 inner join phantom_gabarit g on g.gabarit_id=a.gabarit_id and a.etat_id in(1) and c1.version_id in(1) and a.supprimer=0 and a.pere= order by ordre limit 1
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 ordre limit 1' at line 6