I have a products database driven website that I am building in dreamweaver, where I am inserting data into and I would like to set it so that if a record with this ‘code’ has already been inserted then it will update the particular record. I have this code so far which inserts the data into a table so far and am not sure what I need to add to this code to get the record to update if it has already been inserted into the table:
if ((isset($_POST[“MM_insert”])) && ($_POST[“MM_insert”] == “form3”)) {
$insertSQL = sprintf(“INSERT INTO ProductsUpdated (Code
, Web_Price
, Overriden
) VALUES (%s, %s, %s);”,
GetSQLValueString($_POST[‘Code’], “text”),
GetSQLValueString($_POST[‘Web_Price’], “double”),
GetSQLValueString($_POST[‘Overriden’], “int”));
Any help would be much appreciated.