|
|
Voir le sujet précédent :: Voir le sujet suivant |
Auteur |
Message |
sylvain78 frontpage mioche
|
moteur de recherche , Posté le: 03-02-2004 9:22 |
|
|
voila, je n'y arrive pas alors je poste en esperant trouver qq'un qui résolve mon pb
j'ai un formulaire de recherche sur une page moteur.php
ma balise form (a retenir, en gros, 4 champs : 3 listes et un champs text de saisi)
Code: |
<form method="post" action="resultat.php">
<table width="70%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>&</td>
<td>&</td>
</tr>
<tr>
<td>Intitul&</td>
<td><INPUT class=formreponse size=40 name=titre></td>
</tr>
<tr>
<td>Secteur</td>
<td><SELECT name=secteur class=formreponse>
<?php
do {
?>
<option value="<?php echo $row_secteur['secteur']?>"<?php if (!(strcmp($row_secteur['secteur'], $row_secteur['secteur']))) {echo "SELECTED";} ?>><?php echo $row_secteur['secteur']?></option>
<?php
} while ($row_secteur = mysql_fetch_assoc($secteur));
$rows = mysql_num_rows($secteur);
if($rows > 0) {
mysql_data_seek($secteur, 0);
$row_secteur = mysql_fetch_assoc($secteur);
}
?>
</SELECT></td>
</tr>
<tr>
<td>Centre</td>
<td><SELECT name=centre class=formreponse>
<?php
do {
?>
<option value="<?php echo $row_centre['centre']?>"<?php if (!(strcmp($row_centre['centre'], $row_centre['centre']))) {echo "SELECTED";} ?>><?php echo $row_centre['centre']?></option>
<?php
} while ($row_centre = mysql_fetch_assoc($centre));
$rows = mysql_num_rows($centre);
if($rows > 0) {
mysql_data_seek($centre, 0);
$row_centre = mysql_fetch_assoc($centre);
}
?>
</SELECT></td>
</tr>
<tr>
<td>R&gion</td>
<td><SELECT name=region class=formreponse>
<?php
do {
?>
<option value="<?php echo $row_region['region']?>"<?php if (!(strcmp($row_region['region'], $row_region['region']))) {echo "SELECTED";} ?>><?php echo $row_region['region']?></option>
<?php
} while ($row_region = mysql_fetch_assoc($region));
$rows = mysql_num_rows($region);
if($rows > 0) {
mysql_data_seek($region, 0);
$row_region = mysql_fetch_assoc($region);
}
?>
</SELECT></td>
</tr>
<tr>
<td>Pays</td>
<td><SELECT name=pays class=formreponse>
<?php
do {
?>
<option value="<?php echo $row_pays['pays']?>"<?php if (!(strcmp($row_pays['pays'], $row_pays['pays']))) {echo "SELECTED";} ?>><?php echo $row_pays['pays']?></option>
<?php
} while ($row_pays = mysql_fetch_assoc($pays));
$rows = mysql_num_rows($pays);
if($rows > 0) {
mysql_data_seek($pays, 0);
$row_pays = mysql_fetch_assoc($pays);
}
?>
</SELECT></td>
</tr>
<tr>
<td>Prix</td>
<td>&</td>
</tr>
<tr>
<td colspan="2" align="center"><small><input type="checkbox" name="allcriteres" value="oui">Obligatoirement tous les critères</td>
</tr>
<tr>
<td>&</td>
<td><input type="submit" name="recherche" value="Cherche"></td>
</tr>
</table>
<br>
</form> |
mais voilà je n'arrive pas à configurer ma page résultat pour aller chercher dans la table (ici la table liée est 'formations')
c'est un formulaire de recherche vers une table FORMATIONS
qui contient 4 champs principaux... le pb c'est que je ne sais pas comment faire pour faire ce moteur de recherche
Si qq'un peut m'aider, merci |
|
|
djsunn30 frontpage mioche
|
moteur de recherche , Posté le: 21-02-2004 19:24 |
|
|
pour configurer ta page il faut envoyer le formulaire sur ta page de resultat puis la faire une requete sql vers ta base de donne, et ensuite afficher les resultats.
sur ce site tu trouvera comment alimenter ta base, et faire des requetes
www.phpdebutant.org/
bon script |
|
|
|
|
Accueil Forum
-> php |
Toutes les heures sont au format GMT + 1 Heure
|
Page 1 sur 1 |
|
S'enregistrer
Profil
Se connecter pour vérifier ses messages privés
Rechercher
Membres
FAQ
Connexion
|