Salve ragazzi non riesco a trovare l'errore nella query che vi elenco qui sotto:
codice:
$na = "C I A";
echo $na;
$indirizzi = array();
$query = "SELECT * FROM enti WHERE tipo_ente = ".$na;
$result = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
while ($ente = mysql_fetch_assoc($result)) {
$indirizzi[] = $ente["email"];
}
}
mysql_free_result($result);
if ($indirizzi)
{
...
ECCO L'ERRORE CHE GENERA:
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 'I A' at line 1
saluti