Dicevo le OR e AND nelle if, mentre nelle query devi mettere AND e OR.
Codice PHP:
if ((!empty($_POST['settore'])) || (!empty($_POST['organismo'])) || (!empty($_POST['norma'])) || (!empty($_POST['certificato'])) || (!empty($_POST['dal'])) || (!empty($_POST['al'])) || (!empty($_POST['azienda'])) || (!empty($_POST['campo_appl_cert'])) || (!empty($_POST['stato'])) || (!empty($_POST['regione'])) || (!empty($_POST['provincia'])) || (!empty($_POST['citta'])) ) {
for($x=1;$x>$num_righe;$x++){
$querystr = "SELECT * FROM cliente WHERE intID!=1 && settore = \"$keysSettore[$x]\" OR settore LIKE \"%$keysSettore[$x]%\" OR organismo = \"$keysOrganismo[$x]\" OR organismo LIKE \"%$keysOrganismo[$x]%\"";
$result = mysql_query($querystr) or die ("Errore query filtrata!");
if ($result)) {
$found=true;
do {
echo "" . $frow["settore"] . " - ".$frow["organismo"]."
" . $frow["norma"] . " - " . $frow["certificato"] . "
" . $frow["dal"] . " - " . $frow["al"] . "
" . $frow["azienda"] . " - " . $frow["campo_appl_cert"] . "
". $frow["stato"] . " - ". $frow["regione"] . " - " . $frow["provincia"] . " - " . $frow["citta"] . "
<hr> ";
} while ($frow = mysql_fetch_array($result));
}
}
}
Ho corretto un pò qua e la.
Provalo. Sperando sia giusto...
Ho cambiato gli OR con ||, aggiustato un AND nella query e la seconda if l'ho fatta verificare con la query, non con l'array.