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.
Query related content like youtube.com
Moderator: General Moderators
Re: Query related content like youtube.com
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.
It is just idea. You can implement exact search you want.
Code: Select all
//$current_news_keyword should be keyword of current news.
$query = “select * from news where match (keyword, description) against (‘”. $current_news_keyword .”’)”;Re: Query related content like youtube.com
Thanks a lot. I'm working with fulltext search.