InnerJoin and Filtering
-
Creating table:
SELECT posts_page.post_title AS page_post_title,
posts_page.post_type AS page_post_type,
wp_users.display_name as user
FROM wp_posts AS posts_page
inner join wp_users on wp_users.id = posts_page.post_author
WHERE 1=1
AND posts_page.post_type = ‘page’Config filter to ‘selectbox’ on column
user
Error in log:
Unknown column ‘wp_posts.user’ in ‘where clause’ for query SELECT SQL_CALC_FOUND_ROWS posts_page.post_title AS page_post_title, posts_page.post_type AS page_post_type, wp_users.display_name AS user FROM wp_posts AS posts_page INNER JOIN wp_users ON wp_users.id = posts_page.post_author WHERE 1 = 1 AND posts_page.post_type = ‘page’ ANDwp_posts
.user
LIKE ‘%admin%’ ORDER BYpage_post_title
ASC LIMIT 10
- The topic ‘InnerJoin and Filtering’ is closed to new replies.