session_start(); include "inc_bdd.php"; include "inc_func.php"; $label = $_GET['label']; $produit = mysql_query("select * from produits where label = '$label'"); if (!mysql_num_rows($produit)) echap('nos-produits.php'); $id_produit = mysql_result($produit, 0, 'id'); if (isset($_GET['panier'])) { if (!in_array($id_produit, $_SESSION['panier'])) array_push($_SESSION['panier'], $id_produit); } $id_gamme = mysql_result($produit, 0, 'id_gamme'); $gamme = mysql_query("select * from gammes where id = '$id_gamme'"); $color = mysql_result($gamme, 0, 'color'); $gammes = mysql_query("select * from gammes where id != '$id_gamme'"); $nb_gammes = mysql_num_rows($gammes); $types = mysql_query("select t.nom, l.hot, count(*) as n from types_liens l left join types t on t.id = l.id_type where l.id_produit = '$id_produit' group by l.id_type"); $nb_types = mysql_num_rows($types); $allergenes = mysql_query("select * from allergenes where id in(select distinct id_allergene from allergenes_liens where id_produit = '$id_produit')"); $nb_allergenes = mysql_num_rows($allergenes); $produits = mysql_query("select * from produits where id_gamme = '$id_gamme' && id != '$id_produit' order by rand() limit 3"); $nb_produits = mysql_num_rows($produits); $suite = mysql_query("select id, nom, label from produits where id_gamme = '$id_gamme'"); $nb_suite = mysql_num_rows($suite); for ($n = 0; $id_produit != mysql_result($suite, $n, 'id'); $n++); ?>
|
$mouli = mysql_result($produit, 0, 'suggestions');
$mouli = str_replace(' |
| Idées recettes associées |