Good night, I have a table in SQL where I will put movie recommendations for the users, but I want it when it reaches a total of records in this table, it deletes the oldest records.
My code looks like this:
$sql = "INSERT INTO filmes_rec (filmes)
VALUES ('$recomendacao')";
if($link->query($sql) === TRUE) {
echo 'Obrigado por compartilhar seu gosto com a gente, você recomendou:<br>';
echo '<p class="strong"><strong>';
echo $recomendacao;
echo '</strong></p>';
} else {
echo "Error creating new record";
}