Welcome Guest, Not a member yet? Register   Sign In
Conceptual question: tags in blog posts
#11

[eluser]yelirekim[/eluser]
How exactly would you associate a single record (a single tag) with multiple different items on your site, for example let's say that I want to apply the tag "codeigniter" to several of the posts on my blog. You can't attach multiple parentIDs to a single record. In order to do this with the system you're talking about, you need to create a new record for every single tag on every single blog posting, duplicating the tag names in many cases.
#12

[eluser]Xeoncross[/eluser]
[quote author="yelirekim" date="1218492100"]In order to do this with the system you're talking about, you need to create a new record for every single tag on every single blog posting, duplicating the tag names in many cases.[/quote]

Oh! Thats right!
However, they method posted still isn't right either (unless only one table uses tags).

How about this:

Tables:
Code:
tags : id, name
tags_for : tag_id, item_id, type,

posts : id, title, content
links : id, title, url
files : id, name, url

Code:
$query = '
select * from (posts left join tags_for on posts.id = tags_for.item_id) left join tags on tags_for.tag_id = tags.id';
#13

[eluser]xwero[/eluser]
I didn't say my solution was the silver bullet solution Smile
#14

[eluser]Xeoncross[/eluser]
Well, yours might actually be the "silver bullet" for someone (with only one table) - but while this topic is up I just wanted to see what the best way to do this is because I need to build something like this soon... ;-)




Theme © iAndrew 2016 - Forum software by © MyBB