Answer the question
In order to leave comments, you need to log in
Disagreements CURTIME and SUBTIME?
I wrote in php something similar to a radio based on VKontakte and its API. It works like this: I parse the tracks from the playlist into the database and take a random song and send it to the status (I also specify CURTIME to avoid repetitions). But the problem is this: songs played for example from 18:00 to 23:59 will not be repeated until 21:00 the next evening. Thus, the playlist is drastically cut and there are simply not enough songs to play.
This is how I pull the songs that were last played three hours ago:
SELECT * FROM `music` WHERE `time` <= SUBTIME(CURTIME(), '03:00:00') AND 1 ORDER BY RAND() LIMIT 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question