Bonjour et merci de porter intérêts à mon problème !
mais je crois que j'ai mal posé ma questions et ce que j'affiche plus haut c'était le résultat d'un echo $sql; ...désolé !
Pour être claire voici mon code:
<html>
<head>
<title>Moteur de recherche</title>
</head>
<body>
<?php
$sql_server="localhost";
$sql_user="root";
$sql_pass="";
$sql_bdd="sport";
mysql_connect("$sql_server","$sql_user","$sql_pass") or die("Erreur de connexion au serveur $sql_server");
mysql_select_db("$sql_bdd") or die("Erreur de connexion à la base de données $sql_bdd");
include 'pagination/pagination_moteur.php';
if(isset($_POST['recherche']) ) //Vérification de la présence d'un mot clef
{ //code 1
$_POST['recherche']=strtolower($_POST['recherche']);
$words = str_replace("+", " ", trim($_POST['recherche']));
$words = str_replace("\"", " ", $words);
$words = str_replace(",", " ", $words);
$words = str_replace(":", " ", $words);
$tab=explode(" " , $words);
$nb_words=count($tab);
$sql = " SELECT * FROM `annonce` where `produit` like \"%$tab[0]%\" OR `categorie` like \"%$tab[0]%\" OR `annonce` like \"%$tab[0]%\" ";
$resultat = mysql_query($sql);
$nb_entrees = mysql_num_rows($resultat);
$entrees_par_page = 5;
$total_pages = ceil($nb_entrees/$entrees_par_page);
if ($page=='page2') {
include('page2.php');}
if(!isset($_GET['page'])){
$page_courante = 1;
} else {
$page = $_GET['page'];
if ($page<1) $page_courante=1;
elseif ($page>$total_pages) $page_courante=$total_pages;
else $page_courante=$page;
}
$start = ($page_courante * $entrees_par_page - $entrees_par_page);
$query = " SELECT * FROM `annonce` where `produit` like \"%$tab[0]%\" OR `categorie` like \"%$tab[0]%\" OR `annonce` like \"%$tab[0]%\"LIMIT $start, $entrees_par_page ";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
$id =$row['nbrann'];
$date=$row['date'];
$nom=$row['nom'];
$prix=$row['prix'];
$email=$row['email'];
$code=$row['code'];
$annonce=stripslashes($row['annonce']);
$photo=$row['photo'];
echo "<table align=center>";
echo "<tr>"; echo "<td> Nom:$nom</td>"; echo"<td> </td>";echo "<th> Prix:$prix</th>"; echo "</tr>";
echo "<tr>"; echo "<TD><a href=\"mailto:$email\"> $email</a></td>"; echo"<td> </td>"; echo"<td> </td>"; echo "<tr>";
echo "<tr>"; echo "<td valign=top>Annonce:$annonce</td>";echo"<td> </td>"; if ($photo!=""){ echo "<th><img src=\"C:\wamp\www\ybet\image_annonce/$photo\"width=\"130\" height=\"130\"></th>";} else{echo "<th><center>no photos</center></th>";}echo "</tr>";
echo "<tr>"; echo "<td> Date:$date</td>"; echo "<td>  </td>";
echo"<th>";
echo"<form method=\"POST\" action=\"index.php?page=moteur\">";
echo"<input name=\"id\" type=\"hidden\" value=\"$id\">";
echo"<input type=\"submit\" value=\"look\">";
echo"</form>";
echo"</th>";
echo "</tr>";
echo "<br><br>";
echo "</table>";
}
echo $query;
echo "<br><br>";
echo pagination_moteur($total_pages,$page_courante);
}
?>
</body>
</html>