Codice PHP:
if ($_POST['QSearch']!=""){
echo ("<fieldset><legend>Ricerca libera</legend>");
$stringhe=explode(" ", $_POST['QSearch']);
$query = "SELECT * FROM Test WHERE";
foreach ($stringhe as $stringacercata) {
$stringa = strtolower ($stringacercata);
$query .= "LOWER(Posizione) LIKE '%".$stringa."%' OR LOWER(Autore) LIKE '%".$stringa."%' OR LOWER(Titolo) LIKE '%".$stringa."%' OR LOWER(Editore) LIKE '%".$stringa."%' OR LOWER(Anno) LIKE '%".$stringa."%' OR LOWER(ISBN) LIKE '%".$stringa."%'"
}
$query.=" ORDER BY Autore";
$Res=mysql_query($query, $MyConn);
if (mysql_num_rows($Res) == 0) echo {("Non è stato trovato niente");}
else {
echo ("<table class=\"db\">".$TabHead_LibriClienti);
while ($Entry= mysql_fetch_array($Res))
echo ("<tr><td>".$Entry['ID']."</td><td>".$Entry['Posizione']."</td><td>".$Entry['Autore']."</td><td>".$Entry['Titolo']."</td><td>".$Entry['Editore']."</td><td>".$Entry['Anno']."</td><td>".$Entry['ISBN']."</td><td>".$Entry['Note']."</td><td>".$Entry['Prestato']."</td></tr>");
echo ("</table>");
}
echo ("</fieldset>");
}
mi dà
codice:
Parse error: syntax error, unexpected '}' in /home/mhd-01/www.nethanel.it/htdocs/biblioteca/cerca.php on line 83
se la tolgo (è quella di chiusura del foreach)
codice:
Parse error: syntax error, unexpected T_VARIABLE in /home/mhd-01/www.nethanel.it/htdocs/biblioteca/cerca.php on line 83
....?