I have a problem with this code which I would like to insert a record into a table but if it already exists then update the existing record. This is my code so far:
if ((isset($POST["MM_insert"])) && ($POST["MM_insert"] == "form4")) {
$insertSQL = sprintf("INSERT INTO ProductsUpdated (Code, Web_Price, Overriden) VALUES (%s, %s, %s) ON DUPLICATE KEY UPDATE SET Web_Price=%s",
GetSQLValueString($POST['Code'], "text"),
GetSQLValueString($POST['Web_Price'], "text"),
GetSQLValueString($_POST['Overriden'], "int")); <Line 53
mysql_select_db($database_WebPriceUpdates, $WebPriceUpdates);
$Result1 = mysql_query($insertSQL, $WebPriceUpdates) or die(mysql_error());
I get the error message:
Warning: sprintf() [function.sprintf]: Too few arguments in C:\wamp\www\Test.php on line 53
Not sure what I am missing in this any help would be much appreciated.