What I want to do is, when something new comes into the database, it gets the latest value entered and plays a specific song depending on what it says.
For example, on my computer, I run this website. Say somebody else around the world picked up their phone and clicked to play a song, that song would automatically play on all devices running the page. When somebody chooses a new song, the song should change.
I have made several tries at this, mainly trying to use setInterval in JavaScript however it just updates and updates all the time as you would expect.
I guess what I really am looking for is a way to track when the database has been updated, any solutions or code examples I can use?