SELECT *
FROM <code>wpm3_posts</code> p
JOIN wpm3_users u ON p.post_author = u.ID
JOIN wpm3_postmeta pm ON p.ID = pm.post_id AND pm.meta_key = 'website_id'
JOIN wpm3_posts p1 ON pm.meta_value = p1.ID
WHERE p.post_type = 'phw_comment_loc';
SELECT p.post_date, p.post_title, u.display_name, p1.post_title, p.comment_count
FROM <code>wpm3_posts</code> p
JOIN wpm3_users u ON p.post_author = u.ID
JOIN wpm3_postmeta pm ON p.ID = pm.post_id AND pm.meta_key = 'website_id'
JOIN wpm3_posts p1 ON pm.meta_value = p1.ID
WHERE p.post_type = 'phw_comment_loc';
-
This topic was modified 3 years ago by duhblow7.