select * from annuaire_site A, annuaire B where A.id_annuaire_site=B.id_annuaire_site and B.statut=1 and B.id_annuaire_categorie= order by A.titre_annuaire_site 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 A.titre_annuaire_site' at line 5