SELECT p.* FROM sport_to_categ AS sc JOIN categorie_to_produit AS cp ON (sc.id_categ = cp.id_categ) JOIN produit AS p ON (p.id = cp.id_prod ) WHERE 1 = 1 AND sc.id_sport = AND p.prix_mini >0 AND sc.rang <=5 ORDER BY p.vues LIMIT 0,10;
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 'AND p.prix_mini >0 AND sc.rang <=5 ORDER BY p.vues LIMIT 0,10' at line 1