Created
December 1, 2010 16:11
-
-
Save natematias/723705 to your computer and use it in GitHub Desktop.
one record per WordPress user account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT wp_users.user_login, wp_users.user_nicename, wp_users.user_email | |
| GROUP_CONCAT(CONCAT(meta_key, ": ", meta_value)), | |
| FROM wp_users JOIN wp_usermeta ON wp_users.id = wp_usermeta.user_id | |
| GROUP BY wp_users.user_login; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes, I want to know all of the information about a given wordpress user in one row. This is made difficult by the key/value table usermeta. Here is the query I use to select that information into one row per user.