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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| <?php
include"connexion.php";
if(isset($_GET['id']))
$id=$_GET['id'];
$sql2="select id,id_categorie from tab_site";
$res2 = mysql_query($sql2);
$sites = array();
while(list($idsite,$idcat) = mysql_fetch_array($res2)){
$sites[$idsite] = $idcat;
}
$i = 0;
$ss = array();
foreach ($sites as $key=>$value){
$sql="select * from tab_site where id=".$key." AND ".$id." in (".$value.")";
$res = mysql_query($sql);
$rows = mysql_num_rows($res);
if ($rows > 0)
{
$ss[$i] = mysql_fetch_array($res);
$i++;
}
}
foreach ($ss as $site){
echo"<br>";
echo $site['site'];
}
?>
$i++;
}
}
foreach ($ss as $site){
echo"<br>";
echo $site['site'];
}
?> |
Partager