table 'tags' will have cols 'id' and 'tag'
table 'posts' will have cols 'id', 'post', and 'user_id'
table 'users' will have cols 'id' and 'user'
table 'post_tag' will have cols 'p_id' and 't_id'
to get all the posts from 1 user that contain a certain tag you would query:
Code:
SELECT 'post'
FROM users
LEFT JOIN posts ON (users.id=posts.user_id)
LEFT JOIN post_tag ON (posts.id=p_id)
LEFT JOIN tags ON (t_id=tags.id)
WHERE users.id='$user'
This way you will only have to have one row per tag, you won't have a bunch of redundant data.
Bookmarks