What do you mean by creating another table?
In the second option I am creating another table name tags to store the connection between the posts and tags.
tags
I'm sorry, I totally missed. I just though that you would storage the array in a varchar (or any lob type) using JSON o separating it with |.
I would go for this three tables: posts, tags and post_tags (Or any naming you like).
posts --> All the posts tags --> A master table with all the tags post_tags --> A table with a post_id and tag_id to do the many to many relationship.
A table with a post_id and tag_id to do the many to many relationship.
You mean a single row of post_tags can contain multiple tags_id column.
post_tags
tags_id
I mean something like:
posts
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What do you mean by creating another table?
In the second option I am creating another table name
tags
to store the connection between the posts and tags.I'm sorry, I totally missed. I just though that you would storage the array in a varchar (or any lob type) using JSON o separating it with |.
I would go for this three tables: posts, tags and post_tags (Or any naming you like).
posts --> All the posts
tags --> A master table with all the tags
post_tags --> A table with a post_id and tag_id to do the many to many relationship.
You mean a single row of
post_tags
can contain multipletags_id
column.I mean something like:
posts
tags
post_tags