sql join problem
I want to select all posts that contain a specific tag. I'm trying it with this query:


    SELECT GROUP_CONCAT(t.tag_name) taglist
    FROM posts p
    JOIN posts_tags pt ON p.post_id = pt.post_id
    JOIN tags t ON t.tag_id = pt.tag_id
    WHERE (p.post_private = 0) AND t.tag_name = 'php'
    GROUP BY p.post_id

Problem is, the query above, selects all the posts that contain the `php` tag, but doesn't select any of the other tags a post may contain. Without the `AND t.tag_name = 'php'` part, it does select every tag a post has, but I want to be able to filter by tag...

Any ideas how to do this? I've tried many things, but can't figure it out...
sql join problem
===

I want to select all posts that contain a specific tag. I'm trying it with this query:


    SELECT GROUP_CONCAT(t.tag_name) taglist
    FROM posts p
    JOIN posts_tags pt ON p.post_id = pt.post_id
    JOIN tags t ON t.tag_id = pt.tag_id
    WHERE (p.post_private = 0) AND t.tag_name = 'php'
    GROUP BY p.post_id

Problem is, the query above, selects all the posts that contain the `php` tag, but doesn't select any of the other tags a post may contain. Without the `AND t.tag_name = 'php'` part, it does select every tag a post has, but I want to be able to filter by tag...

Any ideas how to do this? I've tried many things, but can't figure it out...