b_vassy Posted November 4, 2006 Share Posted November 4, 2006 HiI'm building a site that, among others, deals with user submited articles. One of the things i want the site to do is show in a box related articles to the one the visitor reads. The first thing that i thought of was to organize the articles in categories and randomly choose 2 or 3 articles from that category to show as related. But, let's take for example PHP, since i'm here. If i create a category called "PHP Articles" and somebody reads an article about "Arrays in PHP" and i show as related article "Woking with files in PHP", it's not that good. For this to work i'd have to create categories for all php topics. I'm sure there is a better way to do this, but i can't find it :(One thing i thought of was to add tags to articles (like youtube or other video sites do). But i don't know how to build the query so to show the articles where most tags match. What i want to say: Let's suppose the article the user reads has 5 tags. How do i build a query that searches for all tags and returnes the articles where most tags match?This is just an idea. If you can think of a more simple one, please...Thank you Link to comment https://forums.phpfreaks.com/topic/26145-how-do-i-select-articles-that-relate-to-the-one-im-reading/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.