Hi need to modify this php script to update the values in my db row instead of delete and creating again. I have other fields in the same row I don't want to touch. Can you help me? Here is the code:
$data = array(
'email' => "'".$connection->real_escape_string($_POST['Email'])."'",
'plan' => "'".$connection->real_escape_string($_POST['Plan'])."'",
'date_created' => 'NOW()',
'ip' => "'".$_SERVER['REMOTE_ADDR']."'",
);
$sql = "REPLACE INTO `".$SETTINGS["data_table"]."` (`".implode("`, `", array_keys($data))."`)VALUES(".implode(", ", array_values($data)).")";
if ($connection->query($sql) === TRUE) {
$last_id = $connection->insert_id;
Tried to replace "REPLACE INTO" with "UPDATE" but obviously not worked