par
AMDC » 01 mars 2011, 10:53
Bonjour,
Je réalise un moteur de recherche d'annonce immo.
Je souhaite que le formulaire de recherche propose les critères de choix sur la base des annonces.
Je récupères les données de ma requête mais pas les valeur dans les menu déroulants.
Ci-dessous le code du formulaire.
Merci d'avance
<html>
<?PHP
include ('connexion.php');
$query1 = "SELECT DISTINCT * FROM annonces";
$result1 = mysql_query($query1);
while($row = mysql_fetch_row($result1)){
$id= "$row[0]";
$titre= "$row[1]";
$ref= "$row[2]";
$description= "$row[3]";
$prix= "$row[4]";
$photo_principale= "$row[5]";
$date_ajout= "$row[6]";
$typetransaction= "$row[7]";
$type= "$row[8]";
$adresse= "$row[9]";
$code_postal= "$row[10]";
$ville= "$row[11]";
$pays= "$row[12]";
$departement= "$row[13]";
$nom_contact= "$row[14]";
$prenom_contact= "$row[15]";
$tel_contact= "$row[16]";
$mail_contact= "$row[17]";
$active= "$row[18]";
$note= "$row[19]";
$secteur= "$row[20]";
$etat_interieure= "$row[21]";
$surface_habitable= "$row[22]";
$nombre_piece= "$row[23]";
$nombre_chambre= "$row[24]";
$surface_terrain= "$row[25]";
$etage= "$row[26]";
$cuisine= "$row[26]";
$nombre_wc= "$row[27]";
$nombre_salle_de_bain= "$row[28]";
$chauffage= "$row[29]";
$consommation_energetique= "$row[30]";
$proche= "$row[31]";
$les_plus= "$row[32]";
}
?>
<form action='annonce.php' method='post'>
<table>
<tr>
<td>Type de transaction</td>
<td>Type de Bien</td>
<td>Département</td>
<td>Secteur</td>
<td>Ville</td>
</tr>
<tr>
<td><SELECT name='Typetransaction'><OPTION VALUE='<?PHP echo "$typetransaction";?>'></OPTION></td>
<td><SELECT name='Type'><OPTION VALUE='<?PHP echo "$typetransaction";?>'></OPTION></td>
<td><SELECT name='departement'><OPTION VALUE='<?PHP echo "$departement";?>'></OPTION></td>
<td><SELECT name='Proche'><OPTION VALUE='<?PHP echo "$proche";?>'></OPTION></td>
<td><SELECT name='ville'><OPTION VALUE='<?PHP echo "$ville";?>'></OPTION></td>
</tr>
<tr>
<td>Nombre de pièces</td>
<td>Nombre de chambres</td>
<td>Surface mini</td>
<td>Prix Mini</td>
<td>Prix Maxi</td>
</tr>
<tr>
<td><SELECT name='nombre_piece'><OPTION VALUE='<?PHP echo "$nombre_piece";?>'></OPTION></td>
<td><SELECT name='nombre_chambre'><OPTION VALUE='<?PHP echo "$nombre_chambre";?>'></OPTION></td>
<td><INPUT type='text' name="surface_mini"></td>
<td><INPUT type='text' name="prix_mini"></td>
<td><INPUT type='text' name="prix_maxi"></td>
</tr>
<tr>
<input type='submit' value='Rechercher'</form>
</tr>
</html>
Bonjour,
Je réalise un moteur de recherche d'annonce immo.
Je souhaite que le formulaire de recherche propose les critères de choix sur la base des annonces.
Je récupères les données de ma requête mais pas les valeur dans les menu déroulants.
Ci-dessous le code du formulaire.
Merci d'avance
<html>
<?PHP
include ('connexion.php');
$query1 = "SELECT DISTINCT * FROM annonces";
$result1 = mysql_query($query1);
while($row = mysql_fetch_row($result1)){
$id= "$row[0]";
$titre= "$row[1]";
$ref= "$row[2]";
$description= "$row[3]";
$prix= "$row[4]";
$photo_principale= "$row[5]";
$date_ajout= "$row[6]";
$typetransaction= "$row[7]";
$type= "$row[8]";
$adresse= "$row[9]";
$code_postal= "$row[10]";
$ville= "$row[11]";
$pays= "$row[12]";
$departement= "$row[13]";
$nom_contact= "$row[14]";
$prenom_contact= "$row[15]";
$tel_contact= "$row[16]";
$mail_contact= "$row[17]";
$active= "$row[18]";
$note= "$row[19]";
$secteur= "$row[20]";
$etat_interieure= "$row[21]";
$surface_habitable= "$row[22]";
$nombre_piece= "$row[23]";
$nombre_chambre= "$row[24]";
$surface_terrain= "$row[25]";
$etage= "$row[26]";
$cuisine= "$row[26]";
$nombre_wc= "$row[27]";
$nombre_salle_de_bain= "$row[28]";
$chauffage= "$row[29]";
$consommation_energetique= "$row[30]";
$proche= "$row[31]";
$les_plus= "$row[32]";
}
?>
<form action='annonce.php' method='post'>
<table>
<tr>
<td>Type de transaction</td>
<td>Type de Bien</td>
<td>Département</td>
<td>Secteur</td>
<td>Ville</td>
</tr>
<tr>
<td><SELECT name='Typetransaction'><OPTION VALUE='<?PHP echo "$typetransaction";?>'></OPTION></td>
<td><SELECT name='Type'><OPTION VALUE='<?PHP echo "$typetransaction";?>'></OPTION></td>
<td><SELECT name='departement'><OPTION VALUE='<?PHP echo "$departement";?>'></OPTION></td>
<td><SELECT name='Proche'><OPTION VALUE='<?PHP echo "$proche";?>'></OPTION></td>
<td><SELECT name='ville'><OPTION VALUE='<?PHP echo "$ville";?>'></OPTION></td>
</tr>
<tr>
<td>Nombre de pièces</td>
<td>Nombre de chambres</td>
<td>Surface mini</td>
<td>Prix Mini</td>
<td>Prix Maxi</td>
</tr>
<tr>
<td><SELECT name='nombre_piece'><OPTION VALUE='<?PHP echo "$nombre_piece";?>'></OPTION></td>
<td><SELECT name='nombre_chambre'><OPTION VALUE='<?PHP echo "$nombre_chambre";?>'></OPTION></td>
<td><INPUT type='text' name="surface_mini"></td>
<td><INPUT type='text' name="prix_mini"></td>
<td><INPUT type='text' name="prix_maxi"></td>
</tr>
<tr>
<input type='submit' value='Rechercher'</form>
</tr>
</html>