questo è il "motore" che modifica dei dati
Codice PHP:
<?php
$db_username = 'root';
$db_password = '';
$db_host = '127.0.0.1';
$url = "lista_utenti_tabella.php";
$link = mysql_connect("$db_host", "$db_username", "$db_password") or die("Errore connessione: ". mysql_error());
mysql_select_db('iscrizione') or die("Errore apertura database: " . mysql_error());
$strsql = "UPDATE iscritti SET username='" . $_POST['username'] . "', nome='" . $_POST['nome'] . "', cognome='" . $_POST['cognome'] . "', email='" . $_POST['email'] . "', citta='" . $_POST['citta'] . "', provincia='" . $_POST['provincia'] . "' WHERE id = " . $_POST['id'];
$rs = @mysql_query("$strsql",$link) or die("Errore query database:" . mysql_error());
echo "Dati aggiornati";
header('Refresh: 2; url=' . $url);
?>
solo che mi restituisce questo errore
codice:
Notice: Undefined index: id in D:\EasyPHP-5.3.3\www\modifica.php on line 12
Errore query database: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 '' at line 1
non riesco a capire perchè sembra che ci sia un problema qui WHERE id = " . $_POST['id'];
ma non riesco a capire come aggiustare