I am using this query to get results from two tables:
SELECT * FROM (
SELECT parent_id as mID, count(*) as cnt
FROM wp_forum_posts
WHERE text LIKE '%{$word}%'
GROUP by 1
UNION ALL
SELECT id, count(*)
FROM wp_forum_threads
WHERE subject LIKE '%{$word}%'
GROUP by 1) x
ORDER BY 2, 1
I want to select some more values from wp_forum_threads
. Values like subject
.
How can I do this?
Simply adding behind id
does not work. the query returns no result, then.