2011-10-26 8 views

答えて

0

私があなたを理解していれば、full text searchが必要です。

ここにコードがあります。

SELECT id, title, content, link FROM (
SELECT news_id AS id, news_title AS title, news_description AS content, 
MATCH (news_description, news_title) AGAINST ('$keyword') AS relevance FROM tbl_news 
UNION ALL 
SELECT package_id AS id, package_title AS title, package_description AS content, 
MATCH (package_description, package_title) AGAINST ('$keyword') AS relevance FROM tbl_packages 
)temp_sort_table 
WHERE relevance >0 ORDER BY relevance DESC LIMIT $offset,$limit 
関連する問題