Code : Tout sélectionner
$demande = "SELECT DISTINCT Titre FROM fiche WHERE region = `". mysql_real_escape_string($_POST['region'])."`";Code : Tout sélectionner
<?php
$demande = "SELECT DISTINCT Titre FROM fiche WHERE region = `". mysql_real_escape_string($_POST['region'])."`";
//$demande = "SELECT Titre FROM fiche WHERE fiche.region = categorie.region ";
$result = mysql_query($demande);
while($data = mysql_fetch_assoc($result))
{
$nb_fiche_fini="SELECT COUNT(*) AS compteur2 FROM `".htmlspecialchars($data['Titre'])."`";
$req_nb_fiche_fini=mysql_query($nb_fiche_fini) ;
$row2 = mysql_result($req_nb_fiche_fini,0) ;
$nb3 = $row2["compteur2"];
//on affiche les informations de l'enregistrement en cours
$region = " select region from fiche ";
$region1 = " select region from categorie ";
if($nb3 == 0){}
//if($region == $region1){
//return (TRUE);
else{
echo '<p> <a href="./categorie.php?f='.$data['Titre'].'">'.preg_replace('/_/',' ',htmlspecialchars($data['Titre'])).'('.$nb3.')</a><br></p>';
//}
}
}
?>
<?php
$demande = "SELECT Titre FROM fiche WHERE region = '".mysql_real_escape_string($_POST['region'])."'";
$result = mysql_query($demande);
while($data = mysql_fetch_assoc($result))
{
$nb_fiche_fini="SELECT COUNT(*) AS compteur2 FROM `".htmlspecialchars($data['Titre'])."`";
$req_nb_fiche_fini=mysql_query($nb_fiche_fini) ;
$row2 = mysql_result($req_nb_fiche_fini,0) ;
$nb3 = $row2["compteur2"];
if($nb3 == 0){}
else{
echo '<p> <a href="./categorie.php?f='.$data['Titre'].'">'.preg_replace('/_/',' ',htmlspecialchars($data['Titre'])).'('.$nb3.')</a><br></p>';
}
}
?>
Code : Tout sélectionner
<form action="fiche.php" method="post">
<select id="data_region">
<option value="annuaire">annuaire</option>
<option value="Cinéma & TV">Cinéma & TV</option>
<option value="sport">sport</option>
</select>
<input type="submit">
</form>
<?php echo '<a href="../index.php">Accueil</a> => <a href ="/fichit/includes/Type.php">Consulter les fiches</a> => <a href ="/fichit/includes/fiche.php?f='.$titre1.'">'.$titre1.'</a>'; ?>
</div>
<h1>Fiches Disponibles</h1>
<?php
$demande = "SELECT Titre FROM fiche WHERE region = '$titre1' ORDER BY Nom "
$result = mysql_query($demande);
while($data = mysql_fetch_assoc($result))
{
echo '<p> <a href="./categorie.php?f='.$data['Titre'].'">'.preg_replace('/_/',' ',htmlspecialchars($data['Titre'])).'('.$nb3.')</a><br></p>';
}
}
?>