Ok, so for my forum, I'm just wondering how I can display threads that have relative posts when someone searches.
So, for example, if someone searches "apples", and there is a thread that has a post containing the word "apples" in it, select that thread.
At the moment I join the posts onto the thread something similar to this (simplified):
[sql]SELECT `T`.*, `P`.*FROM `Threads` `T`LEFT OUTER JOIN `Posts` `P` ON `P`.`Threadid` = `T`.`ID`GROUP BY `T`.`ID`HAVING `T`.`Subject` LIKE '%apples%' OR `T`.`Post` LIKE '%apples%' OR `P`.`Subject` LIKE '%apples%' OR `P`.`Post` LIKE '%apples%'[/sql]
However, this only returns threads that contain apples in the starting subject/post, not the rest of the posts in the thread.
I'm not really sure how to do this...any help would be cool, or just a point in the right direction.
Cheers,
Jack.