I'm new to mysql query and I'm having issue with lots of same data duplicates on my database when inserting new records.
What I want is to delete old records and keep the latest one only
I have tried offset limit but not working rather deleting all
INSERT INTO follow
(sender_id, receiver_id, name, photo1)
VALUES ('".$_POST["sender_id"]."', '".$_SESSION["user_id"]."', '".$phot["user_RealName"]."', '".$phot["photo"]."')
";
$gk=mysqli_query($db,"delete from follow where sender_id = '{$_POST['sender_id']}'
AND receiver_id = '{$_SESSION['user_id']}'
offset 1 desc
");