MySQL Forums
Forum List  »  PHP

Void rows on INSERT and UPDATE commands
Posted by: Rob Locomotiva
Date: April 21, 2010 08:34AM

Hello there,
I got a serious and strange problem with a simply function that should modify data from a form in a php page. Every time I try to update data, I found in the tables the old row with all the fields cleared, and a new void row. I tried to replace ' with ", but nothing change. This is the code, can anyone help me, please?

$query = "UPDATE software SET nome_s='$_POST[nome_s]', house_s='$_POST[house_s]' WHERE id_s ='$_GET[id]' LIMIT 1";
$connessione=mysql_connect($hostname, $user, $password);
if ($connessione==FALSE) {echo "connessione fallita <BR>";}
mysql_select_db($db_name, $connessione)
or die ("Errore nella selezione del database. Verificare i parametri nel file config.inc.php");
$result = mysql_query($query,$connessione);
if ($result==FALSE) {echo "<CENTER><B>L'inserimento/aggiornamento del record è fallito.</B></CENTER>";}
else {echo "<CENTER><B>Il record è stato inserito/aggiornato correttamente.</B></CENTER>";}
mysql_close($connessione);



Thank you everybody.

Options: ReplyQuote


Subject
Written By
Posted
Void rows on INSERT and UPDATE commands
April 21, 2010 08:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.