session_start(); include "inc_bdd.php"; include "inc_func.php"; $label = $_GET['label']; $gamme = mysql_query("select * from gammes where label = '$label'"); if (!mysql_num_rows($gamme)) echap('nos-produits.php'); $id_gamme = mysql_result($gamme, 0, 'id'); $color = mysql_result($gamme, 0, 'color'); $type = isset($_GET['type']) ? $_GET['type'] : 0; $types = mysql_query("select * from types where id in(select id_type from types_liens where id_produit in(select id from produits where id_gamme = '$id_gamme'))"); $nb_types = mysql_num_rows($types); $produits = mysql_query("select * from produits where id_gamme = '$id_gamme'".($type ? " && id in(select id_produit from types_liens where id_type = '$type')" : "")."order by new desc, ordre"); $nb_produits = mysql_num_rows($produits); ?>