salut tt le monde je suis debutante et il faut que je fais un site bon bref je suis bloquée je ne sais pas comment mettre les resultat des enregistrements ds des pages.svp aidez moi en plus corrigez moi .Merci d'avance
<? session_start();
if(isset($_POST["BT_chercher"])){
mysql_connect("localhost", "root", "");
mysql_select_db("viadeo");
if(!empty($_POST["raison_social"]))
{$raison = isset($_POST['raison_social']) ? $_POST['raison_social'] : '';
// Vérification que raison social existe
$result = mysql_query("SELECT * FROM Raison_Social
WHERE
Raison_Social like %$raison%");
// Si une erreur survient
if(!$result)
{
$message = "Désolé, aucune page de ce site ne contient <b>"$_POST['raison_social']</b>;
}
else
{
// Si un enregistrement est trouvé
if(mysql_num_rows($result) > 0)
{ $secteur=mysql_query("select Secteur from Secteur where Id_raison like%raison%");
$pays=mysql_query("select Pays from Pays where Id_raison like%raison%");
$row = mysql_fetch_array($result))
echo "Raison Social :".$row['Raison_Social'];
echo "Adresse : ".$row['Adresse'];
echo "Tel. ".$row['Tel'];
echo "Site ".$row['Site'];
echo "Fonction".$row['Fonction'];
echo "secteur".$secteur;
echo"Pays".$pays;
}
}
}
}
elseif(!empty($_POST["list_secteur"]))
{$resultat=mysql_query("select Id_raison,Secteur from Secteur where Secteur like%'" . $_POST["list_secteur"] . "'");
if(mysql_num_rows($resultat) > 0)
{while($row = mysql_fetch_array($resultat))
{
$id_raison=mysql_result($row,"Id_raison");
$secteur=mysql_result($row,"secteur");
$result = mysql_query('SELECT * FROM Raison_Social
WHERE
Id_Raison = '" .$id_raison. "'');
echo "Raison Social :";
echo $row['Raison_Social'];
echo "Adresse : ";
echo $row['Adresse'];
echo "Tel. ";
echo $row['Tel'];
echo "Site ";
echo $row['Site'];
echo "Fonction ";
echo $row['Fonction'];
echo "Secteur ";
echo $secteur;
$pays=mysql_query("select Pays from Pays where Id_Raison = '" .$id_raison. "'");
echo "Pays";
echo $pays;
}}
// Si une erreur survient
if(!$resultat)
{
$message ="Désolé, il n'y a pas de raison social inscrit dans ce site pour "<b>$_POST["list_secteur"]</b>...;
}
}
elseif(!empty($_POST["list_pays"]))
{$resultat=mysql_query("select Id_raison,Pays from Pays where Pays like%'" . $_POST["list_pays"] . "'");
if(mysql_num_rows($resultat) > 0)
{while($row = mysql_fetch_array($resultat))
{
$id_raison=mysql_result($row,"Id_Raison");
$pays=mysql_result($row,"Pays");
$result = mysql_query('SELECT * FROM Raison_Social
WHERE
Id_Raison = '" .$id_raison. "'');
$k = mysql_fetch_array($result)
echo "Raison Social :";
echo $k['Raison_Social'];
echo "Adresse : ";
echo $k['Adresse'];
echo "Tel. ";
echo $k['Tel'];
echo "Site ";
echo $k['Site'];
echo "Fonction ";
echo $k['Fonction'];
echo "Pays ";
echo $pays;
$pays=mysql_query("select Secteur from Secteur where Id_Raison = '" .$id_raison. "'");
echo "Secteur";
echo $secteur;
}}
// Si une erreur survient
if(!$result)
{
$message = "Désolé, aucune page de ce site ne contient" <b>$_POST["list_pays"]</b>;
}
}
} ?>
?>
<head>
<style type="text/css">
<!--
.Style3 {
font-size: 18px;
font-weight: bold;
}
.Style5 {font-size: 24px; font-weight: bold; }
-->
</style>
</head>
<body>
<br /><br /><br /><br /><br /><br /><br /><br />
<span class="Style5">Chercher une Société selon: </span>
<form action="http://<?= $_SERVER["SERVER_NAME"] . $_SERVER["page.php"]; ?>" method="post">
<center><table width="399">
<tr>
<td width="184" class="Style3">Raison Social:</td>
<td width="203">
<label>
<input type="text" name="raison_social" />
</label> </td>
</tr>
<tr>
<td class="Style3">Secteur :</td>
<td><select name="list_secteur" style="width:auto">
<option></option>
<?php
$Req1 = mysql_query( "SELECT Secteur FROM Secteurs");
if( mysql_num_rows( $Req1 ) > 0 ) {
while( $Secteur = mysql_fetch_array($Req1) ) {
?>
<option><?php echo $Secteur; ?></option>
<?php
}
}
?>
</SELECT></td>
</tr>
<tr>
<td class="Style3">Pays : </td>
<td><select name="list_pays" style="width:146">
<option></option>
<?
$sql="select * from Pays";
$res = mysql_query($sql);
while(mysql_fetch_row($rs))
{
$pays=mysql_result($rs,"Pays")
?>
<option><? echo $pays;?></option><? } ?>
</select> </td>
</tr>
<tr>
<td></td>
<td><center><input type="submit" name="BT_chercher" value="chercher" /></center></td>
</table></center>
</form>
</body>
</html>