Buonasera mi dite cortesemente perche questo script che ho creato non va? dove sto sbagliando? Grazie.
Codice PHP:
<?php
if(isset($_POST['update'])) {
$dbhost = 'localhost';
$dbuser = 'mia user';
$dbpass = 'mia password';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$Tessera = $_POST['Tessera'];
$Codice_agenzia = $_POST['Codice_agenzia'];
$Agenzia = $_POST['Agenzia'];
$Cognome = $_POST['Cognome'];
$Nome = $_POST['Nome'];
$Cap = $_POST['Cap'];
$Codice_fiscale = $_POST['Codice_fiscale'];
$Codice_cliente = $_POST['Codice_cliente'];
$Indirizzo = $_POST['Indirizzo'];
$Sesso = $_POST['Sesso'];
$Comune = $_POST['Comune'];
$Data_di_nascita = $_POST['Data_di_nascita'];
$Indirizzo_email = $_POST['Indirizzo_email'];
$Telefono = $_POST['Telefono'];
$Username = $_POST['Username'];
$Password = $_POST['Password'];
$Comune_di_nascita = $_POST['Comune_di_nascita'];
$sql = "UPDATE Profilo ". "SET Tessera = $Tessera , Codice_agenzia = $Codice_agenzia , Agenzia = $Agenzia , Cognome = $Cognome ,Nome = $Nome , Codice_fiscale = $Codice_fiscale , Codice_cliente = $Codice_cliente , Indirizzo = $Indirizzo , Sesso = $Sesso , Comune = $Comune , Data_di_nascita = $Data_di_nascita , Indirizzo_email = $Indirizzo_email , Telefono = $Telefono , Username = $Username , Password = $Password ". "WHERE Tessera = $Tessera" ;
mysql_select_db('mio_db');
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
echo "Aggiornamento avvenuto correttamente\n";
mysql_close($conn);
}else {
?>