Online playlist with PHP/MySQL question

Torben,

I use the script from the Wiki, works fine…
Only, the database grows and grows…
Is there a way to only populate 10 entries? (overwriting)

Regards,
Ferry

What’s wrong with a comprehensive archive of all songs ever played? At eldoradio, we have one that goes all the way back to 2002 or so.

If you created a proper index with CREATE INDEX, read performance should not suffer at all.

Mainly concerned about data growth.
Also no need to search into history.
As the DB is running at the hosting provider, I like to reduce data / space

Just regularly run a query that deletes all entries older than, say, two days:

DELETE FROM playlistlog WHERE starttime < DATE_SUB(CURDATE(), INTERVAL 2 DAY);

(untested)

That works in a manual query :slight_smile:
Will test this in-script.

Thanks!