Ciao a tutti
vi posyo lo script usato per la query INSERT INTO in php:
<?php
if (isset($_POST['submit']) && $_POST['submit']=="invia")
{
$nome = @addslashes($_POST['nome']);
$indirizzo = @addslashes($_POST['indirizzo']);
$citta = @addslashes($_POST['citta']);
$piva = @addslashes($_POST['piva']);
$cf = @addslashes($_POST['cf']);
$telefono1 = @addslashes($_POST['telefono1']);
$telefono2 = @addslashes($_POST['telefono2']);
$fax = @addslashes($_POST['fax']);
$email = @addslashes($_POST['email']);
$referente = @addslashes($_POST['referente']);
$ruoloreferente = @addslashes($_POST['ruoloreferente']);
$note = @addslashes($_POST['note']);
$banca = @addslashes($_POST['banca']);
$abi = @addslashes($_POST['abi']);
$cab = @addslashes($_POST['cab']);
$cin = @addslashes($_POST['cin']);
$iban = @addslashes($_POST['iban']);
include 'connessione.php';
$sql = "INSERT INTO fornitori(nome,indirizzo,citta,piva,cf,telefono1,t elefono2,fax,email,referente,ruoloreferente,note,b cana,abi,cab,cin,iban) VALUES ('$nome', '$indirizzo', '$citta, '$piva', '$cf', '$telefono1', '$telefono2', '$fax', '$email', '$referente', '$ruoloreferente', '$note', '$banca', '$abi', '$cab', '$cin', '$iban')";
if($result = mysql_query($sql) or die (mysql_error()))
{
echo "Inserimento avvenuto con successo.
<a href=\"formfornitore.php\">Inserimento Nuovo Fornitore</a>";
}
mysql_close();
}else{
?>
<title>Codifica Fornitore</title><body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<form action="formfornitore.php" method="post">
<div align="center">Anagrafica Fornitore </div>
<table width="64%" border="1" align="center" height="425">
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Ragione
Sociale</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="nome" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Indirizzo</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="indirizzo" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Città</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="citta" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Partita
Iva</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="piva" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Codice
Fiscale</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="cf" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Telefono
1 </font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="telefono1" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Telefono
2 </font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="telefono2" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Fax</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="fax" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Email</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="email" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Referente</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="Referente" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Ruolo
Referente </font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="ruoloreferente" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Note</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="note" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Banca</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="banca" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Abi</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="abi" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Cab</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="cab" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Cin</font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="cin" type="text" size="80">
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Codice
Iban </font></div>
</td>
<td width="72%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<input name="iban" type="text" size="80">
</font></div>
</td>
</tr>
</table>
<div align="center">
<font face="Arial, Helvetica, sans-serif">
<input name="submit" type="submit" value="invia">
</font></p>
</div>
</form>
<div align="center"><font face="Arial, Helvetica, sans-serif">
<?php
}
?>
</font></div>
Mi restituisce sempre questo errore, ma sinceramente non capisco dove possa stare questo errore:
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 'c', 'c', 'c', 'c', 'c', 'c', '', 'c', 'c', 'c', 'c', 'c', 'c', 'c')' at line 1
GRAZIE A TUTTI COLORO CHE VORRANNO AIUTARMI