Welcome Guest, Not a member yet? Register   Sign In
Is the there a better way to implemet a tagging system?
#1

[eluser]satsilem[/eluser]
Some thoughts and questions about organising posts.

For a long time I was creating websites where on my dynamic content I used the model, one category -> many children
for example,

category: news category 1
post: My latest story 1
post: My latest story 2

category: news category 2
post: My latest story 3
post: My latest story 4

and so on. Then I decided to use a more flexible way to organise my content, by using a tagging system, where a post can be assignet to multiple tags. I tried to find the best way to implement this functionality and this is where I am so far:

I created three database tables like this

posts
post_id
title
text

post_tags
tag_id
title

post_to_tags
tag_id
post_id


Well now I need some help. My lack of knowledge in MySQl is a problem because I want to make certain tasks and as I understand I must create complex JOIN queries and I don_t have the expertise to do this. If there is someone able to help me it would be a greate help to undrestand and making my idea work.

Actions:
1. Select all posts where a tag id = $this->uri->segment(3)
2. Select all posts where the tag_id is the same with the post I am viewing (the tags might be more than one)



Any ideas will be helpfull.
Thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB