ecco cosa mi dà con l'istruzion sql che mi hai postato:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REGEXP 'prova'' at line 1
questa è la query:
Codice PHP:
$ricerca=$_REQUEST["ricerca"];
$QueryRis=@mysql_query("Select * From archivio Where Campo1Like '%$ricerca%' or Campo2 Like '%$riceca%' or Campo3 Like '%$ricerca%' Order by Campo1 Asc LIMIT $start,$recperpag REGEXP '$ricerca'") or die (mysql_error());
ho provato facendo così:
Codice PHP:
$arrtesto=explode(" ",$ricerca);
foreach($arrtesto as $pretesto)
$testo=str_replace($pretesto,"[b]".$pretesto."[/b]",$RecRis["Campo2"]." ".$RecRis["Campo3"]);
}
echo $testo;
ma non so perchè mi mette in grassetto solo l'ultima parola tipo se effettuo una ricerca "ciao bella"
mi mette in grassetto solo le parole bella.