I'm generally a front end developer (HTML/CSS etc) but currently getting my chops stuck into some back end development for a challenge. Please bear in mind I've only been doing this back-end thing for a few weeks so my terminology / logic is in its infancy... Go easy ;)
As a starting point, I'm building a thing in PHP & MySQL so I can catalogue my vinyl collection. It's a really simple form that takes artist, title, label etc and stores that into a MySQL db. I also want to implement tags for each record so one track might be tagged 'House | funky | vocal' whilst another would be tagged 'dubstep | MC | Bass' or something like that.
I can't store these tags as an array in MySQL so I understand that I need to insert them as a comma separated value and then when I want to work with these at a front-end level, I need to pull the CSV out of the database, EXPLODE that value and display each element as a separate list element.
That part I understand. But how do I go about adding additional tags? I can't seem to find a definitive answer (maybe I'm searching the wrong thing?) but so far, all I can work out is that I'd have to take the current database value of 'tags' from the db and store that as a variable. Delete the 'tags' value from the db, append a new tag to the variable and then store the new variable back into the database.
Surely there's an easier way though?