I need to get the "title" field if the "content" field contains a certain phrase. With the title I can do the actual query to get the posts.
-- psuedo code --
$query1 ='SELECT `title` FROM `posts` WHERE `content` CONTAINS 'matchtest'
ORDER BY `id` ASC, LIMIT 1';
$titlefromquery1;
$query2 = 'SELECT * FROM `posts` WHERE `title` = 'Reply to: ' . $titlefromquery1;
$repliesfromquery2;
The replies don't have the phrase to match fortunately the "titles" will always be "Reply to: $title" which is why both queries are needed it seems
Is there any way conditionally or otherwise to avoid a double query here?