SQL ERROR: 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 (offrePrix_nbVenteRestant > 0 OR o' at line 26
SELECT offre_id, offre_nom, offre_priorite, offreProduit_id, offreProduit_quantite, offreProduit_produitId, produit_id, produit_nom, produit_poids, produit_enCrossDock, produit_stock, offrePrix_prixNormal, offrePrix_prix, offrePrix_datetimeDebut, offrePrix_datetimeFin, produitVisu_produitId, produitVisu_fichier, produit_stock, offre_visuFichier FROM offres LEFT JOIN offre_produits ON offre_id = offreProduit_offreId LEFT JOIN produits ON offreProduit_produitId = produit_id LEFT JOIN offre_prix ON offre_id = offrePrix_offreId LEFT JOIN produit_visus ON produit_visuDefautId = produitVisu_id WHERE offre_gammeId = AND (offrePrix_nbVenteRestant > 0 OR offrePrix_nbVenteRestant IS NULL) AND offrePrix_datetimeDebut <= '2012-05-22 05:17:19' AND (offrePrix_datetimeFin IS NULL OR offrePrix_datetimeFin >= '2012-05-22 05:17:19') GROUP BY offre_id ORDER BY offre_priorite DESC, produit_nom limit 0,8
SQL ERROR: 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 ((NOW() BETWEEN offrePrix_datetimeDebut and offrePrix_datetimeFin) OR (NOW()' at line 12
select gammeTopOffre_gammeId, gammeTopOffre_offreId, gammeTopOffre_position, offre_id, offre_nom, offrePrix_prix, offrePrix_datetimeDebut, offreProduit_defaut, offrePrix_datetimeFin, offrePrix_prixNormal, produit_nom, produit_stock, produitVisu_produitId, produitVisu_fichier, produit_enCrossDock, produit_poids, offre_visuFichier from offres left join gamme_topoffres on offre_id=gammeTopOffre_offreId left join offre_prix on offre_id=offrePrix_offreId left join offre_produits on offre_id=offreProduit_offreId left join produits on offreProduit_produitId=produit_id left join produit_visus on produit_visuDefautId=produitVisu_id where gammeTopOffre_gammeId= and ((NOW() BETWEEN offrePrix_datetimeDebut and offrePrix_datetimeFin) OR (NOW()>offrePrix_datetimeDebut and offrePrix_datetimeFin is null)) and (offre_nom is not null or offreProduit_defaut=1) order by gammeTopOffre_position