Tu ne sais pas ce que tu distu feras aussi bien que moi
Bon, voilà ce que j'ai fait.
<?php
// Récupération des données du formulaire
$MotRech = $_POST['MotRech'];
?>
<input type="hidden" name="MotRech" value="<? echo $MotRech;?>">
<?php
//Connection à la base//
$lien = mysql_connect("xx","xx","x");
mysql_select_db("xx", $lien);
//Requête pour rechercher dans les champs de la table groupes//
$ReqGroupe = "SELECT IdGroupe, NomGroupe,
MATCH (NomGroupe, AutreNomGroupe,Presentation, InfCompl)
AGAINST ('".$MotRech."' IN BOOLEAN MODE) AS cpt
FROM groupes
ORDER BY cpt DESC";
$ResGroupe=mysql_query($ReqGroupe) or die('Il y a eu une erreur : <strong>' . mysql_error() .
'</strong><br>Dans : <br>' . $ReqGroupe);
//Parcourir le tableau et afficher s'il y a des résultats//
while ($ValGroupe=mysql_fetch_row($ReqGroupe))
{
if ($ValGroupe>0)
{
?>
<a href="zz.php?IdGroupe=<?php echo $IdGroupe; ?>"><?php echo $NomGroupe; ?><br />
<?php
}
}
// Requête pour rechercher dans les champs de la table societes//
$ReqSociete = "SELECT IdSociete, NomSociete,
MATCH (NomSociete, AutreNomSociete,Presentation, InfCompl)
AGAINST ('".$MotRech."' IN BOOLEAN MODE) AS cpt
FROM societes
ORDER BY cpt DESC";
$ResSociete=mysql_query($ReqSociete) or die('Il y a eu une erreur : <strong>' . mysql_error() .
'</strong><br>Dans : <br>' . $ReqSociete);
while ($ValSociete=mysql_fetch_row($ReqSociete))
{
if ($ValSociete>0)
{
?>
<a href="xx.php?IdSociete=<?php echo $IdSociete; ?>"><?php echo $NomSociete; ?><br />
<?php
}
}
// Requête pour rechercher dans les champs de la table produits//
$ReqProduit = "SELECT IdProduit, NomProduit,
MATCH (NomProduit, Presentation)
AGAINST ('".$MotRech."' IN BOOLEAN MODE) AS cpt
FROM produits
ORDER BY cpt DESC";
$ResProduit=mysql_query($ReqProduit) or die('Il y a eu une erreur : <strong>' . mysql_error() .
'</strong><br>Dans : <br>' . $ReqProduit);
while ($ValProduit=mysql_fetch_row($ReqProduit))
{
if ($ValProduit>0)
{
?>
<a href="yy.php?IdProduit=<?php echo $IdProduit; ?>"><?php echo $NomProduit; ?><br />
<?php
}
}
mysql_close($lien);
?>
J'ai l'impression que ce n'est pas la bonne fonction tableau: il m'indique une erreur pour les trois $Val
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in ...