Niente da fare, il problema si ripeto, mi carica tutti i campi vuoi nel db!
Ma sai cosa ho notato? Se scrivo:
Codice PHP:
$cognome="ROSSI";
me lo inserisce nel db senza problemi!
Quindi adesso l'errore non sta più nella query, ma come se passaggio di parametri!
Intanto io ho sempre fatto così:
nel form:
Codice PHP:
<?php
echo $_SESSION['user111'];
$utente= mysql_query("SELECT * FROM utenti WHERE user_id=\"$_SESSION[user111]\" ");
$utente1 = mysql_fetch_array($utente);
echo $utente1['id'];?>
<form method="post" action="index.php?page=18&upload=<?php echo $utente1['id']; ?>" onSubmit="return formCheck(this)">
<table width="550" border="0" align="center">
<tr>
<td>[b]Cognome:[/b]</td>
</tr>
<tr>
<td><input name="cognome" type="text" size="30" value="<?php echo $utente1['cognome']; ?>" /></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>[b]Nome: [/b]</td>
</tr>
<tr>
<td><input name="nome" type="text" size="30" value="<?php echo $utente1['nome']; ?>" /></td>
</tr>
<tr>
.......//+ tutti gli altri campi!
<tr>
<td align="center"><input type="submit" name="submit" value="Aggiorna i dati personali!" /></td>
</tr>
</table>
</form>
nell'inserimento:
Codice PHP:
if(isSet($_GET["upload"])){
$id_utente=$_GET["upload"];
echo $id_utente;
$cognome="htmlentities($_POST['cognome']);
$nome="htmlentities($_POST['nome']);
//htmlentities di tutti campi passati e poi l'update!
$a = mysql_query("UPDATE utenti SET cognome = '$cognome', nome = '$nome', eta = '$eta', via = '$via', cap = '$cap', citta = '$citta', provincia = '$provincia', mobile = '$mobile', telefono = '$telefono', fax = '$fax', msn = '$msn', homepage = '$homepage' WHERE id = '$id_utente' ");
if($a)print("<script> alert('Dati personali aggiornati correttamente!')</script>");
} ?>