Salve,
questa è la struttura della tabella param:
id int(11) unsigned PRI NULL auto_increment
anno int(4) 0
desc varchar(255)
importo varchar(255) 0
codice:
if(isset($_POST['Aggiungi'])) {
$anno = $_POST['txtanno'];
$desc = $_POST['txtdesc'];
$impo = $_POST['txtimporto'];
$query = "INSERT INTO param (anno, desc, importo) VALUES ('$anno', '$desc', '$impo')";
if(mysql_query($query, $db)) { echo "<font face=\"Verdana\" size=\"-1\">Record aggiunto con successo nel database.</font>
"; } else { echo "<font face=\"Verdana\" size=\"-1\">MySQL Error: " . mysql_error() . "</font>
"; }
MySQL Error: 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 'desc, importo) VALUES ('2003', 'pirt', '2121,12')' at line
quando provo ad aggiungere un record, ricevo questo errore, qualcuno ha idee del perchè non funzioni?
buon proseguimento