IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Moteur de recherche


Sujet :

PHP & Base de données

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau membre du Club
    Inscrit en
    Mai 2008
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 6
    Par défaut Moteur de recherche
    Salut a tous,
    Voila mon problème, Je souhaite faire un moteur de recherche pour mon site.
    L'adresse du site c'est http://www.natgraphics.oniriquefacto...ilis/index.php si vous voulais voir à quoi ça ressemble.
    C'est un site pour une agence immobilière.
    Voila je voudrais faire un code pour le moteur de recherche dans ma base de données sur plusieurs table. mon site est écrit en php.
    Merci d'avance pour vos réponses.


    Je vous mets mon code néanmoins mon code pour la page sur laquelle je voudrais effectuer la recherche :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Immobilis-achat</title>
    <link href="css/navigation.css" rel="stylesheet" type="text/css" />
    <link href="css/achat_recherche.css" rel="stylesheet" type="text/css" />
    <link href="css/immo_achat.css" rel="stylesheet" type="text/css" />
    </head>
     
    <body>
    <div id="main">
      <div id="header"></div>
        <div id="navigation"> 
      <?php include('include/nav_achat.inc.php'); ?>
      </div>
     
        <div id="achat_gauche">
    	<div id="texte_gauche_vente">
    	Bienvenue dans le monde de l'immobilier!
    	<p>&nbsp;</p>
    	<p>Une équipe de professionnels est à votre service, pour vous guider et vous conseiller dans votre projet d'acquérir un bien.</p>
    	<p>&nbsp;</p>
    	<p>Plusieurs biens vous attendent sur ce site. Insérez les critères de sélection et lancez la recherche.</p>
    	<p>&nbsp;</p>
    	<p>A vous de jouer, vous n'êtes qu'à un clic de votre bonheur.</p>
    	</div>
    </div>
    <div id="milieu">
    		<div id="achat_recherche"><img src="images/achats_photo.jpg"></div>
    		<form action="achat.php" method="get" name="recherche" id="recherche">
    		<div id="achat_recherche_type">			 
    			<table width="175" border="0" cellspacing="5" class="texte_recherche">
    	  			<tr>
        			<td>Type de bien immobilier</td>
     				</tr>
      				<tr>
        			<td>
    				<select name="Type">
    		  			<option>Maison</option>
    		  			<option>Appartement</option>
    		  			<option>Bungalow</option>
    		 			<option>Villa</option>
    		  			<option>Espace commercial</option>
    		  			<option>Terrain</option>
    				</select>
    				</td>
      				</tr>
      				<tr>
        			<td>Ville</td>
      				</tr>
      				<tr>
        			  <td><input name="Input" type="text" class="ville" /></td>
      				</tr>
      				<tr>
        			<td>Fourchette de prix</td>
      				</tr>
      				<tr>
        			<td>de&nbsp;Rs.&nbsp;<input name="" type="text" class="prix" size="15" />
        			&nbsp;</td>
      				</tr>
      				<tr>
        			<td>à&nbsp;Rs.&nbsp;&nbsp;&nbsp;<input name="" type="text" class="prix" size="15" /></td>
      				</tr>
    			</table>
    			<table width="175" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
        <td height="45px"><div align="center" ><input name="search" type="button" class="bouton_recherche" id="search" value="Lancez la recherche"/></td>
        <td>&nbsp;</td>
      </tr>
    </table>
     
    		</div>
    		<div id="achat_recherche_options">
    			<table width="387" border="0" cellpadding="0" class="texte_recherche">
    				<tr>
        				<td width="115">Surface habitable</td>
       				  <td width="70px"><input type="text" class="details" size="2" maxlength="2" /> m2</td>
        				<td>Superficie terrain</td>
        				<td><input type="text" class="details" size="2" maxlength="2" />
        				m2</td>
      				</tr>
      				<tr>
        				<td>Nombre de pi&egrave;ces</td>
        				<td><input type="text" class="details" size="2" maxlength="2" /></td>
        				<td>Chambre &agrave; coucher</td>
        				<td><input type="text" class="details" size="2" maxlength="2" /></td>
      				</tr>
      				<tr>
        				<td>Salle de bains</td>
        				<td><input type="text" class="details" size="2" maxlength="2" /></td>
        				<td>&nbsp;</td>
        				<td>&nbsp;</td>
      				</tr>
    		  </table>
     
    			<table width="380" border="0" cellpadding="0" class="texte_recherche">
    	  			<tr>
        				<td width="10px"></td>
    					<td width="70">Balcon</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td width="140px">Terrasse</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td width="115px">Etage</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
      				<tr>
        				<td width="10px"></td>
    					<td>Jardin</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Cour cloturé</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Volet</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
      				<tr>
        				<td width="10px"></td>
    					<td>Cave</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Grenier</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Garage</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
      				<tr>
        				<td width="10px"></td>
    					<td>Buanderie</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Climatisé</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Porte auto.</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
      				<tr>
        				<td width="10px"></td>
    					<td>Parquet</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Carrelage</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
    					<td>Ascenseur</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
      				<tr>
        				<td width="10px"></td>
    					<td>Piscine</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
        				<td>Système d'alarme</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
    					<td width="10px"></td>
    					<td>Jaccuzi</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
    		  </table>
     
    			<table width="350" border="0" class="texte_recherche" cellpadding="0" cellspacing="0">
      				<tr>
        				<td width="10px"></td>
    					<td>Chauffe-eau solaire</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
        				<td>Chauffe-eau électrique</td>
        				<td width="10px"><input name="" type="checkbox" value="" /></td>
      				</tr>
      			</table>
    		</div>
    	</form>
     
    	</div>
     
     
    <div id="footer">Copyright Immobilis 2008 &copy; - <a href="mailto:natgraphics2004@yahoo.fr?subject= Feedback Immobilis">Contact Webmaster</a></div>

  2. #2
    Membre éclairé Avatar de schwarzy2
    Femme Profil pro
    Développeur Web
    Inscrit en
    Septembre 2006
    Messages
    464
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2006
    Messages : 464
    Par défaut
    ta demande n'est pas très précise...que veux-tu au juste?

  3. #3
    Membre éclairé Avatar de guigouz
    Profil pro
    Étudiant
    Inscrit en
    Mars 2008
    Messages
    84
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2008
    Messages : 84
    Par défaut
    Bonsoir...

    Généralement, pour les moteurs de recherche de ce type, tu peux te contenter d'une requête SQL paramétrée. Il te suffit de savoir quelle sont les tables concernées par ta requête, de faire tes jointures et de paramétrer les conditions de ta requête pour ne recevoir que les valeurs qui t'intéressent...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    $req = 'SELECT champ1, champ2, ... 
    FROM table1, table2, ...
    WHERE table1.monId = table2.monId
    AND ...
    AND tableX.monChamp = '.$maValeur.'
    AND ...;';
    Voila j'espère avoir été clair et correctement répondu a ta question...
    Bonne continuation...

  4. #4
    Membre à l'essai
    Inscrit en
    Juillet 2008
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 6
    Par défaut
    oé et tu peus aussi utiliser la fonction

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
     
    like%$find% " ;
    alors dans la requete Sql aprés choisir tes table

Discussions similaires

  1. [Info]moteur de recherche full text en environnement j2ee
    Par ddams dans le forum API standards et tierces
    Réponses: 4
    Dernier message: 03/11/2004, 19h39
  2. comment faire ma base de donnée pour un moteur de recherche
    Par HoB dans le forum Décisions SGBD
    Réponses: 2
    Dernier message: 04/05/2004, 15h07
  3. Moteur de recherche par date
    Par Prue dans le forum ASP
    Réponses: 17
    Dernier message: 27/08/2003, 16h07
  4. [Technique] Index, comment font les moteurs de recherche ?
    Par bat dans le forum Décisions SGBD
    Réponses: 4
    Dernier message: 25/10/2002, 15h41

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo