1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
$resulttype4=SelectGroupe("type_depart,produits","type_depart.dep_ID,type_depart.id_pays,COUNT(*)AS nbre", "type_depart.dep_ID=produits.dep_ID AND produits.activ=0 AND produits.transac=0", "type_depart.id_pays");
// SelectGroupe est une fonction qui fait un SELECT ... Grouped By
// ici elle selectionne tout les pays ou il y a des produits
while ($row4 = mysql_fetch_array($resulttype4)) {
echo $row4['id_pays']; // affichage du pays
if ( ($Type!="")) {
// maintenant si j'ai cliquée sur un pays (je peux le savoir grace à $Type)
$sql = "SELECT type_depart.dep_ID,type_depart.nom_Dep
FROM type_depart,produits
WHERE type_depart.dep_ID=produits.dep_ID
AND produits.activ=0
AND produits.transac=0
AND type_depart.`id_pays` = '$Type'
GROUP BY type_depart.nom_Dep";
//je cherche les regions (ou departement du pays cliqué) $resulttype3=mysql_query($sql)
or die ("Erreur:".mysql_error().$sql);
while ($row3 = mysql_fetch_array($resulttype3)) { echo $row3['nom_Dep']; // j'affiche la region
}
$Type="";
}
} |
Partager