Page 1 of 1

Query related content like youtube.com

Posted: Sat Oct 03, 2009 10:03 pm
by banmidou
This is my table structure:
news(
id,
title,
keyword,
picture,
description,
content
)
When i user read a news, i want to display related news like this one ( like related video on youtube) . I don't know how to query it.
Please help me.
Thanks for reading.

Re: Query related content like youtube.com

Posted: Sun Oct 04, 2009 12:21 am
by iamngk
you can apply FULLTEXT search for keyword, description column. When you fetch the data for current news, you will get the keyword of that news. You can do the query like below.

Code: Select all

//$current_news_keyword   should be keyword of current news.
$query = “select * from news where match (keyword, description) against (‘”. $current_news_keyword   .”’)”;
It is just idea. You can implement exact search you want.

Re: Query related content like youtube.com

Posted: Sun Oct 04, 2009 6:23 am
by banmidou
Thanks a lot. I'm working with fulltext search.