I need help with a join I think. Can't figure it out.
I have these tables:
Posts
`id` int(10) unsigned NOT NULL,
`title` varchar(140) DEFAULT NULL,
`text` text COLLATE utf8_unicode_ci
Posts tags
`post_id` int(10) unsigned NOT NULL,
`tag_id` int(10) unsigned NOT NULL
Tags
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(40) DEFAULT NULL
If I want to loop out all the posts with the tag team-fortress-2
how would one do that? I can't figure it out.
$q = mysql_query("SELECT * FROM ... WHERE $get['tag']");
while($r = mysql_fetch_array($q)) {