Innanzitutto grazie per l'aiuto e le dritte .. fanno sempre comodo a noi pivellini
In effetti mi da un errore ... grrr .. sembra di sintassi, ma la Sintassi a me pare corretta!
if($ordine=="crescente") { $ord="ASC"; }
elseif($ordine=="decrescente") { $ord="DESC"; }
$cn=mysql_connect($host,$uid,$pw);
mysql_select_db($db,$cn);
$query="INSERT INTO ricerche (key) VALUES ('$stringa')";
$result = mysql_query($query)or die("Errore durante l'inserimento: ".mysql_error());
$sql="SELECT * FROM $tabella WHERE ";
if($criterio=="esatta")
{
$sql.="$campo LIKE '%$stringa%' ORDER BY $ordinaper $ord";
}
elseif($criterio=="almeno")
{
$lista_parole=explode(" ",$stringa);
for($i=0;$i<count($lista_parole);$i++)
{
$str.="$campo LIKE '%$lista_parole[$i]%' OR ";
........................
Questo l'errore
Errore durante l'inserimento: 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 'key) VALUES ('prova')' at line 1