MySQL fulltext search joining tables
Posted on 2011-10-28
I have a fulltext search on one of my tables but I want to also search on another table that is linked to another table (I know that doesn't make any sense yet)
I have 3 tables
I have a fulltext search running on the tblarticle table that looks like this:
mysql_query('SELECT articleID, posterName, articleTitle, articleContent FROM tblblogarticle WHERE MATCH(articleTitle, articleContent) AGAINST ("'.$phrase.'"));
This is working ok, but I woud like to expand my search to include the article tags associated with each article. The link is each article has several entries in the tblarticletags table that stores the articleID and tagID fields. The tbltags table contains the tagID and tagName. I want to search on the tagName with reference back to the original article to display the correct search results.
I guess I am going to have to use joins to do this, but am not sure how to construct it? Any advice is welcomed.