Ciao a tutti sono sempre io 

stavo pensando per il mio programmino di creare una tabella con delle righe selezionabili, e una volta selezionate cancellarle grazie a delle checkbox (fin qui nessun problema).
solo che quando vado a eseguire il programma mi da 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 'ID'] ?> '' at line 1" e non capisco come mai..

vi posto il codice :
Grazie mille anticipatamente per l'interessamento e per eventuali risposte 


stavo pensando per il mio programmino di creare una tabella con delle righe selezionabili, e una volta selezionate cancellarle grazie a delle checkbox (fin qui nessun problema).
solo che quando vado a eseguire il programma mi da 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 'ID'] ?> '' at line 1" e non capisco come mai..


vi posto il codice :
PHP:
<html>
<title>Elimina</title>
<head>
<title>Eliminazione</title>
<style>
table, th, td
{
border: 1px solid black;
}
</style>
</head>
<body>
<h1>Eliminazione</h1>
<form action="Eliminazione.php" method="post" >
<input type="submit" name="id" value="Elimina" onClick="return confirm('Sicuro di voler cancellare questo record ?');" />
<a href='Inserimento.php'><input type="submit" name="Inserimento" value="inserisci un record nel database" /></a>
<a href='Modifica.php'><input type="submit" name="Modifica" value="Modifica un record nel database" /></a>
<a href='Ricerca.php'><input type="submit" name="Ricerca" value="Ricerca un record nel database" /></a>
<table>
<?php
$user="xxxx";
$pass="****";
$dbh = mysql_connect("xxxx","xxxx",$pass);
mysql_select_db('xxxx') or die(mysql_error());
?>
<table style="width:100%">
<tr>
<th>#</th>
<th>ID</th>
<th>Filiale</th>
<th>Ufficio</th>
<th>Utente</th>
<th>Tipo</th>
<th>Marca</th>
<th>Modello</th>
<th>Matricola</th>
<th>Note</th>
<th>DataDDT</th>
<th>DDT</th>
<th>Fornitore</th>
<th>ACQNOL</th>
<th>Scadenza</th>
</tr>
<?php
$user="xxx";
$pass="****";
$dbh = mysql_connect("xxxx","xxxx",$pass);
mysql_select_db('xxxx') or die(mysql_error());
$stmt = ("Select * from gestione");
$ris= mysql_query($stmt) or die($stmt."<br/><br/>".mysql_error());
$count=mysql_num_rows($ris);
while($rigo=mysql_fetch_array($ris))
{
?>
<tr>
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?phpecho $rigo['ID']?>"/></td>
<?php
echo" <td> " . $rigo['ID'] . " </td> <td> " . $rigo['Filiale'] . " </td> <td> " . $rigo['Ufficio'] . " </td> <td> " . $rigo['Utente'] . " </td> <td> " . $rigo['Tipo'] . " </td> <td> " . $rigo['Marca'] . " </td> <td> " . $rigo['Modello'] . " </td> <td> " . $rigo['Matricola'] . " </td> <td> " . $rigo['Note'] . " </td> <td> " . $rigo['DataDDT'] . " </td> <td> " . $rigo['DDT'] . " </td><td> " . $rigo['Fornitore'] . " </td> <td> " . $rigo['ACQNOL'] . " </td> <td> " . $rigo['Scadenza'] . " </tr>";
}
try
{
if(isset($_POST['id']))
{
//echo "<meta http-equiv='Refresh' content='3; URL=Eliminazione.php'>";
if (count($_POST['checkbox']) > 0)
{
foreach ($_POST['checkbox'] as $del_id)
{
$sql = "DELETE FROM gestione WHERE ID =' " . $del_id . " ' ";
$ris = mysql_query($sql) or die(mysql_error());
}
}
}
}
catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
</table>
</form>
</body>
</html>
