Results 1 to 4 of 4
Thread: Fetch related rows from tags
Dec 10, 2012, 13:23 #1
- Join Date
- Mar 2002
- 0 Post(s)
- 0 Thread(s)
Fetch related rows from tags
I'm using a 2 table tagging system for articles (myisam) and I'm trying to get related articles based on the tags and category_id of the article currently being viewed.
What would be the optimal query to achieve this? I only seem to be able to find answers for 3 table tag systems.
`article_id` int(11) NOT NULL DEFAULT '0', `tag` varchar(99) NOT NULL DEFAULT '', PRIMARY KEY (`article_id`,`tag`), KEY `tag_ix` (`tag`)
`article_id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL DEFAULT '', `content` text NOT NULL, `category_id` int(11) NOT NULL, `tags` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`article_id`), KEY `category_id` (`category_id`)