Hi everyone!
I'm still beginning to get my head around this whole relational-database-thingymawhatsit. Anyway, I'm a PHP programmer so I can do all that shabang. I just need to think what would be the best method for this scenario...
I'm developing a site (with CodeIgniter if that's any help) - a site where users can post content (think a blog-style thing). Each post has to have tags, any number of tags, I can't just be constrained to, say, 3 or 5. This has got to be unlimited.
So which of these do I do?
- Put the tags alongside the posts in the same database table, i.e. 'entries' contains 'post', 'title', and 'tags' (and obviously 'id')
- Put the tags in a table of their own and link each tag row to an entry('s) 'id'...?
- ...Something else entirely?
Just need to know the best, most logically structured way of doing this. Thinking about tables communicating with each other is confusing enough...!
Oh, and bonus points to anyone with any CodeIgniter snippets that may get me along on my way ;)
Thanks!
Jack