I have about 50 users. Its pretty easy to list them all. However they are related to a special custom post type through a postmeta field called wpp_agents.
So I need to list Users, but also the post title(linked to the post).
- User 1 | User 1's Post(linked)
- User 2 | User 2's Post(linked)
I am a mysql noob but getting pretty ok with php.
Here is what I am playing with:
$data = $wpdb->get_results( "SELECT $wpdb->users*, "SELECT display_name, user_email FROM $wpdb->users LEFT JOIN $wpdb->usermeta ON user.ID=wpp_agents;", ARRAY_A );
but its not right.
I believe I need to SELECT * FROM $wpdb->users LEFT JOIN $wpdb->postmeta
but then not sure.
any help is greatly appreciated.