Bonjour,

J'ai du mal à comprendre où ça coince dès que je lis mes résultats avec
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
while ( $result = mysql_fetch_array($req))
{
}
J'ai une erreur 1225

Voici mon code
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
 
<!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=utf-8" />
   <title>Recherche Categorie</title>
   <link href="style/style.css" rel="stylesheet" type="text/css" />
 
</head>
 
<body>
       <div id="container">
            <div id="header"><div id="header_left"></div>
            <div id="header_main">Gestion recherche Categorie</div><div id="header_right"></div></div>
            <div id="content" align="center">
            <br>
            Entrez le nom de la categorie    
            <br>    
            <p> </p>
            <br>
            <p> </p>
<?php
 
if ($_POST['recherche'] == "" )
       {
        //on redirige le visiteur sur la page de recherche
        header('location: indexs.php');
 
       }else{
 
 
//
//$db = mysql_connect('localhost', 'root', '');  // connexion à la base
//mysql_select_db('palaisde',$db);
include "config.php";
 
//requete de recherche
$req = mysql_query("SELECT * FROM categories_description WHERE categories_name LIKE '%".$_POST['recherche']."%' Order by categories_id DESC "); 
 
//on compte les resultats
$resultat= mysql_numrows($req); 
 
 
if(empty($resultat)){
 
echo'<div align = "center"><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Désolé mais aucun resultat ne correspond à votre demande</strong></font><br><br></div>';
}
 else{
 
  //on affiche le nombre de resultats
echo'<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr bgcolor="#18447F"> 
    <td colspan="4"> 
<div align="center"><font color="#FFFFFF">Pour le mot </font><em><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>'.$_POST['recherche'].'</strong></font></em> 
       <font color="#FFFFFF"> il y\'a : </font><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><em><strong>';
       if($resultat <=1)
echo''.$resultat.' resultat';
elseif($resultat >1)
echo''.$resultat.' resultats';
echo'</strong></em> 
      </font></div></td>
  </tr>
  <tr> 
 
  </tr><table/>';
//on ressort les infos par ordres alphab�tiques
while( $result = mysql_fetch_array($req))
{
echo'<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr bgcolor="#B8C8FE"> 
    <td width="40%"><b>Nom de la Categorie :</b></td>
    <td colspan="2" bgcolor="#B8C8FE">'.$result['categories_name'].'</td>
  </tr>
  <tr> 
    <td height="3"></td>
    <td></td>
    <td></td>
  </tr>
  <tr bgcolor="#B8C8FE"> 
    <td ><b>Liens vers la Categorie :</b></td>
    <td colspan="2" bgcolor="#B8C8FE"><a href="indexc.php?id='.$result['categories_id'].'">'.$result['categories_id'].'</a></td>
  </tr>
  <tr> 
    <td height="3"></td>
    <td></td>
    <td></td>
  </tr><hr>';
 
}
echo'</table><br>';
}
 
//on ferme la connexion
//mysql_close();
print'<div align = "center"><a href="javascript:history.back();">Retour</a></div>';
}
 
?> 
<p> </p>
             </div>
             <div id="footer"><a href="" target="_blank">lordlifen</a></div>
         </div>
 
</body>   
</html>
Merci de bien vouloir m'aider.