phillystyle123
asked on
Wordpress database - need sql that will add wp_usermeta first_name, last_name to query
I slapped together this sql which generates the users I need. I can't figure out how to add first_name and last_name to this from wp_usermeta. this is what I have so far:
Select * from wp_wpcw_user_courses,wp_wpcw_user_progress, wp_users where course_progress="100"and unit_id="457" and unit_completed_status="complete" and wp_wpcw_user_courses.user_id=wp_wpcw_user_progress.user_id and wp_wpcw_user_courses.user_id=wp_users.ID AND unit_completed_date > "2014-04-15 23:29:31"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Select * from wp_wpcw_user_courses,wp_wp
LEFT JOIN wp_usermeta ON wp_users.ID = wp_usermeta.user_id
AND wp_usermeta.meta_key IN ('first_name', 'last_name')
GROUP BY wp_users.ID
So, I'm trying to show:
ID, first_name, last_name, email