Le probleme avec la requete c'est qu'elle affiche toute les données.
Vous pôuvez revoir la requete svp !!!
je veux que quand je donne un choix depuis la page form.php3 <--- moteur de recherche
me donne juste les informations egal o matricule que je lui ai donné.
<?
include("include/recherche/include/config.inc.php3"); //fichier de config
include("include/recherche/include/header.html"); //header html
include("include/recherche/include/form.php3"); //formulaire de recherche
if (!isset($debut)) $debut = 0;
if (!empty($recherche))
{
$recherche=strtolower($recherche); //on passe en minuscule
$mots = str_replace("+", " ", trim($recherche)); //on remplace les + par des espaces
$mots = str_replace("\"", " ", $mots); //idem pour $mots = str_replace(",", " ", $mots); //idem pour ,
$mots = str_replace(":", " ", $mots); //idem pour :
$recherche=rawurlencode($recherche); //on encode la recherche
$tab=explode(" " , $mots);
$nb=count($tab);
$sql="select * from php_trombino,images where php_trombino.matricule = images.matricule like \"%$tab[0]%\"";
for($i=1 ; $i<$nb; $i++)
{
$sql.="$operateur php_trombino,images like \"%$tab[$i]%\" ";
}
$sql2=$sql; //requete permettant de connaitre le nombre de résultats
$sql.=" Limit $debut,$limit "; // requête limitante.
mysql_connect($host,$user, $passwd);
$result2 = mysql_db_query($db,$sql2);
$result = mysql_db_query($db,$sql);
if($result)
{
$nrows = mysql_num_rows($result2);
$flag = 1;
if(mysql_num_rows($result)==0) echo "<center><b>Pas de Résultat</b></center><br>";
else
{
include("include/recherche/include/header_tab.html");
while($r = mysql_fetch_array($result))
{ ?>
<p><div align="center"> <font face="Verdana">
<table width="89%" height="189" border="0" bgcolor="#CCCCCC">
<tr>
<td width="56%" height="185">
<table width="100%" height="181" border="0">
<tr>
<td height="54"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="0">Matricule
: <? print "$r[matricule]"; ?></font></td>
</tr>
<td height="49"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="0">Nom
: <? print "$r[nom]"; ?></font></td>
</tr>
<td height="48"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="0">Prenom
: <? print "$r[prenom]"; ?></font></td>
</tr>
<td height="20"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="0">Contact
: <? print "<a href=\"mailto:$r[contact]?subject=trombino\">"; ?><? print "$r[contact]"; ?></font></td>
</tr>
</table>
<td width="44%" height="185">
<table width="95%" height="199" border="0">
<tr>
<td height="145"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="0">
<? if (file_exists("include/trombinoscope/$r[file]"))
{
$size = GetImageSize("include/trombinoscope/$r[file]");
$width = $size[0] + 25;
$height = $size[1] + 20;
echo " <TD vAlign=top class=col1><center> \n";
echo " <a href='javascript:openPopWin(\"include/trombinoscope/$r[file]\",$width,$height,\"\",1,1)'> \n";
echo " <img src=\"include/trombinoscope/$r[file]\" width=\"80\" height=\"85\" alt=\"$r[nom]\"> \n";
echo " </center></TD> \n";
}
else
{
echo "<TD vAlign=top bgColor=#CCCCCC><center><img src=\"include/trombinoscope/def.jpg\" width=\"80\" height=\"85\" alt=\"$r[nom]\"></center></TD> \n";
} ?>
</tr>
</table></td>
</tr>
</table>
<? } ?>
</td>
</tr>
</table>
<? mysql_free_result($result);
/****************** Mise en place de la navigation. ************************************/
$nombre=ceil($nrows/$limit);
if($debut>0)
{
echo "<a href=trombino.php?recherche=$recherche&operateur=$operateur&debut=".($debut-$limit)."><--</a>";
}
if ($nombre>1)
{
for($i=1; $i<=$nombre; $i++)
{
echo "<a href=trombino.php?recherche=$recherche&operateur=$operateur&debut=".(($i-1)*$limit).">".$i."</a> ";
}
}
if(($debut+$limit)<$nrows)
{
echo "<a href=trombino.php?recherche=$recherche&operateur=$operateur&debut=".($debut+$limit).">--></a>";
}
echo "</CENTER>";
}
}
}
else
{
echo("<center><br><b>Entrer le matricule de la personne que vous chercher</b></center>");
}
include("include/recherche/include/footer.html");
?>
. :: WebmasterX :: .