I have the following code that registers in the database the id of an article that the user liked.
$sql = "INSERT INTO favoritos (id_user, id_oferta)
VALUES ('$login_session', '$id')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
As I have the code, the user can like the same article as often as he likes.
How can I resolve this situation?