PHP – How would I save user theme preferences in an SQL database so when users login it changes themes?

I’m currently making a music streaming website for fun and trying to add some cool features to it. One of them I came up with is storing dark mode, light mode and background theme preferences (CSS) in the users SQL data so when they login to any device on the same account it will automatically adjust to their theme preferences without having to fiddle around in settings again and again.

Looking at basic tutorials, none of them really mention storing themes in user accounts and more focus on a temporary cookies approach with I personally really don’t like.

Anyone got any ideas? It would literally just be a choice between light-mode.css or dark-mode.css and changing links to the backgrounds.

Thanks,

That’s Interesting.

Nothing, this is just a random idea and need some code to make it work!