loading...

re: Best way to store array type data inside database? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Personally I would use the second approach but make a link table which can group all the tags together via a foreign key. Cheers, Scott
 

I didn't understood the part about making a link table?

Could you please elaborate that?

 

So I would have two tables. The first one would contain the a primary key of post_id and the name or that post.

The second table would contain all the individual tags linked to that one post. You could then make a foreign key link to the first table.

Hope that makes sense. But think you’ve done this already in your second approach.

Good job

Right, but using the concept of foreign key we can only link single tab to the post table, not an array of tags. Right?

I might be wrong too, IDK

code of conduct - report abuse