i really want to add multiple tags to a blog post when a user selects them from a field, but i was wondering in terms of storing the tags in mysql, shall i have field to hold all tags, or shall store one by one i.e.
tags_field = (cats ,animals, fur)
OR
id1 cats
id2 animals
id3 fur
i was thinking to use the first example and then explode the lists and sepearte them into single tags when presenting them to the user!!! :)) thanks
You should use three tables :
tag_id + post_idThis way, one tag can be used by several posts, and one post can have several tags — and there is no duplication of data of any kind.
So, basically, your tables would look like this :