Update Record when doing consecutive updates

Hi,

I am using Dreamweaver to generate some code for an Update Record and then trying to alter this further. I would like to enter data into a database using ‘Update’ then do a subsequent Update which further alters that data. I am trying with the example code below to get this to work. What I need is a bit more complicated but if I can get this work I should be able to work out the rest. However, it enters the form data fine but the second Update just isnt going into the database. If anyone can help with this that would be greatly appreciated:

[COLOR=“DarkGreen”]if ((isset($_POST[“MM_update”])) && ($_POST[“MM_update”] == “form2”)) {
$updateSQL = sprintf(“UPDATE table SET Fieldname=%s, Fieldname2=%s, Fieldname3=%s, Fieldname4=0.2 WHERE id=%s”,
GetSQLValueString($_POST[‘Fieldname’], “text”),
GetSQLValueString($_POST[‘Fieldname2’], “int”),
GetSQLValueString($_POST[‘Fieldname3’], “int”),
// GetSQLValueString($_POST[‘Fieldname4’], “double”),
GetSQLValueString($_POST[‘id’], “int”));

mysql_select_db($database_stuff_db, $stuff_db);
$Result1 = mysql_query($updateSQL, $stuff_db) or die(mysql_error());
$updateGoTo = “Newpage.php”;
if (isset($_SERVER[‘QUERY_STRING’])) {
$updateGoTo .= (strpos($updateGoTo, ‘?’)) ? “&” : “?”;
$updateGoTo .= $_SERVER[‘QUERY_STRING’];
}
header(sprintf(“Location: %s”, $updateGoTo));
}

mysql_select_db($database_stuff_db, $stuff_db);
$query_update1=“UPDATE table SET Fieldname4=321 WHERE id=102”;
$update1 = mysql_query($query_update1, $stuff_db) or die(mysql_error());[/COLOR]

Ta,

HB

The second query isn’t being carried out because there’s a redirect (using header() ) that is being sent to the browser.

Header is just some bytes sent to the browser, it does not stop the script from executing.

Fieldname4 isn’t being sent because it’s commented out, use syntax highlighting, and if you still have a problem let us know.

I have taken out the reference to the header, but it is still not working. I have also realised that in the first UPDATE the value for Fieldname4 is not being sent to the database either, although the other values update fine. I cant work out where the issue is.

Thanks for your time