Here is my code:
if (isset($_GET['id']) && !empty($_GET['id'])) {
$deal_update_sql = "UPDATE mydb.nl_dailydeals SET storeid = '5', cultureid = '10' WHERE product_id = ".$_GET["id"];
$result = mysql_query($deal_update_sql);
}
else {
$insert_query = "INSERT INTO admin_zuki_be.nl_dailydeals (product_id, storeid) VALUES (3, 2)";
$result = mysql_query($insert_query);
}
This code doesn't work. No matter what id I pass within the URL through GET, it should be inserted into the database. If the id is already present in the database, then it should update the record with the given id.
How can I fix this?