I'm creating a hall of fame page in my game and the page will only display the top 15 scores.
So I want to delete the scores that get bumped down the list.
How would I write the query to delete everything NOT in the top 15?
I've been trying different things, but nothing is working.
I thought maybe something like this, but it didn't work.
Code: Select all
$removeold = $db->execute("DELETE FROM `soundoff_hof` WHERE `id` NOT IN (SELECT `id` LIMIT 15 FROM `soundoff_hof`)");