WordPress.org

Ready to get started?Download WordPress

Forums

Cimy User Extra Fields
Solved: Retrieve names for all who checked a box (1 post)

  1. wlindley
    Member
    Posted 2 years ago #

    Great plugin! I needed to retrieve the email address, first and last name for all the registered users on my site who checked an extra-field box marked "thisweek"... The SQL is a bit tricky, but here's how I did it:

    select id, user_email,
      (select meta_value from wp_usermeta where
        meta_key='first_name' and wp_usermeta.user_id = id) as first,
      (select meta_value from wp_usermeta where
        meta_key='last_name' and wp_usermeta.user_id=id) as last
      from wp_users where
        id in (select user_id from wp_cimy_uef_data where
          field_id=(select id as field_id from wp_cimy_uef_fields where
            name like "thisweek") and value like "yes");

    http://wordpress.org/extend/plugins/cimy-user-extra-fields/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by wlindley
  • This topic is not a support question
  • WordPress version: 3.4