MySQL Forums
Forum List  »  French

Re: recherche aproximative avec full text
Posted by: Hakim AZIZI
Date: April 05, 2008 04:29AM

voila ce que j'ai.
pour aider au maximum la fonction j'ai supprimer tous les accents et ransphormé le"y" en "i".
et je n'ai aucune reponse alors que je devrais en avoir une.
je n'ai pas d'erreur sql.

$replace=array("à","é","è","ê","ë","î","ï","ô","ö","ù","û","ü","y");
$by=array('a','e','e','e','e','i','i','o','o','u','u','u','i');
$recherche=str_replace($replace,$by,$_POST["recherche"]);
$rech1=mysql_query("SELECT * FROM produit WHERE SOUNDEX(recherche)=SOUNDEX('".$recherche."')") OR die(mysql_error());

merci
edit a présent j'en suis la mais toujours rien

$sIn = $_POST['recherche'];
if ( $sIn == '' ) return ' ';
// On supprime les accents
$sIn = strtr( $sIn, 'ÂÄÀÇÈÉÊËŒÎÏYÔÖÙÛÜ', 'AAASEEEEEIIIOOUUU' );
$sIn = strtr( $sIn, 'âäàçèéëêœîïyôöùûü', 'aaaseeeeeiiioouuu' );
// On met tout en majuscule
$sIn = strtoupper( $sIn );
echo"sIn=$sIn recherche=".$_POST['recherche']."";
$rech1=mysql_query("SELECT * FROM produit WHERE SOUNDEX(recherche)=SOUNDEX('$sIn')") OR die(mysql_error());
while($rech=mysql_fetch_assoc($rech1))
{
extract($rech);
echo"$id <br>";
}

Probleme regler.
merci a tous

http://www.larosedelorient.com



Edited 2 time(s). Last edit at 04/06/2008 01:13PM by Hakim AZIZI.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: recherche aproximative avec full text
5064
April 05, 2008 04:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.