sql update not working
Hi,
I am trying to update my database with the following code but even though the code definately runs because it does get to the echos on the line before the update, the database is not getting updated.
if ($totalRows_rsportsale >'0') {
$_POST['dpaid'] = 1;
$_POST['listedby'] = $row_rsportid['listedid'];
echo 'dpaid is: ' . $_POST['dpaid'] . '<br />';
echo 'listedby is: ' . $_POST['listedby'] . '<br />';
$updateSQL = sprintf("UPDATE detailstable SET dpaid=%s WHERE listedby=%s",
GetSQLValueString($_POST['listedby'], "int"),
GetSQLValueString($_POST['dpaid'], "int"));
mysql_select_db($database_connUpdate, $connUpdate);
$Result1 = mysql_query($updateSQL, $connUpdate) or die(mysql_error());
}
The values that i want to update in the database are being echoed right before the update script, so the values are correct for dpaid and listedby, i have entered the update bit of the code in the sql in myphp admin and that does update the database. The connection for the database connUpdate is correct. Both fields are "int" in the database and are not primary keys or unique. Any suggestions as to why this update is not working would be much appreciated.
Thank you in advance.