You should’nt really be using wp query here, use get_user_meta();
Example:
$first_name = get_user_meta(2, 'first_name', true);
Related Posts:
- How do you properly prepare a %LIKE% SQL statement?
- $wpdb and MySQL Create Trigger
- wpdb->prepare function remove single quote for %s in SQL statment
- Alternative to mysql_real_escape_string
- Increment value (value = value+1) of $wpdb->update
- wpdb Custom Meta Data with 2 conditions
- wpdb prepare syntax
- SQL query not working in alphabetical post title/content search
- MySQL LIKE not working
- How to check for empty and not a failure
- Database: Custom table: sprintf value for DateTime column
- Converting mysql to $wpdb
- WP_USE_EXT_MYSQL
- wpdb insert and boolean fields
- Join new table with SQL query
- writing inner join in wpdb
- How to split the a table in database?
- MySQL Rank & $wpdb
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- How do I join a $wpdb query with user meta using default value if not exist?
- How to translate this mySQL query to $wpdb query
- $wpdb select all meta for each post
- $wpdb to insert html form information
- Proper usage of $wpdb->update()?
- WordPress(wpdb class) and mysql stored procedures
- Can’t run database query
- Using WPDB->Insert()
- Active DB queries in WordPress?
- How to stop $wpdb from prepending database name
- WordPress $wpdb get posts from category and sort by custom meta
- How to get INSERT errors from $wpdb?
- Getting Error Trying to Create Table
- How to set MYSQLI_OPT_INT_AND_FLOAT_NATIVE option
- Understanding custom php that reads from WP MYSQL
- How to insert dash (-) into database using wpdb and new_to_publish hook?
- $wpdb->get_var multiple queries in one database check
- List users with the most posts in the last 30 days
- Insert two row in wordpress database
- WordPress $wpdb no result
- PHP variables in mysql query
- MySQL ‘duplicate entry’ error
- User set date and time from frontend doesn’t get stored into database
- Wpdb query with dynamic table name
- get posts whether meta_key exists or not
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- How to search usermeta table
- How to add virtual column in wpdb get_result statement
- wpdb insert into point column in db
- WPDB delivers wrong results from complex queries
- $wpdb post type and term query only works when there are no dashes or spaces in the term slug and title
- CONCAT_WS in custom sql query
- Geographical proximity query using post_meta
- MySQL Select within WP Page template
- Saving custom term value to the database in new table
- why is $wpdb->update() causing a DB error from within wp_set_password()
- $wpdb->get_var returns 0
- Initialization of table in database using ‘CREATE … IF NOT EXISTS’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error “Operand should contain 1 column”
- How to use MySQL DECIMAL?
- MySQL ERROR 1290 (HY000) –secure-file-priv option
- MySQL server startup error ‘The server quit without updating PID file’
- Duplicating a MySQL table, indices, and data
- SELECT * FROM multiple tables. MySQL
- MySQL foreach loop
- MySQL Calculate Percentage
- Get the new record primary key ID from MySQL insert query?
- How to change collation of database, table, column?
- Failed building wheel for mysql-python
- How to get the max of two values in MySQL?
- mysql: connection refused when trying to connect to localhost using remote IP
- Using wpdb to connect to a separate database
- wpdb->insert multiple record at once
- Complex meta query with 3 keys
- How to log mysql errors from wordpress core?
- How can I make wordpress suppress mysql errors?
- How to bulk delete all WordPress subscribers?
- Ajax $wpdb not returning table data
- Changing Table Prefix for an Existing WordPresss Site
- Set meta_key and meta_value for all registered user in wordpress using sql query [closed]
- Can’t get wp_insert_post to work
- Connect another DB and fetch records from some tables
- Error: MySQL shutdown unexpectedly [closed]
- Connect to MySQL using Windows Authentication
- How do I prepare strings for insertions as values into a MySQL table?
- MySQL: How to change url in posts from xxx.com to yyy.org?
- WordPress & MySQL , problem with use many array in meta_query
- Button writing to MYSQL database
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- WordPress Dutch characters encoding problem
- How do I insert content of various MySQL fields in post?
- Select latest 2 articles, but only from given category
- Ordering topics by most replies in X days using MYSQL statement
- MySQL database migration to WordPress
- Running WordPress from MySQL Cluster with HAPRoxy
- cannot log in to the mysql server (wamp and wordpress)
- SQL command to export post_content from wp_posts using phpMyAdmin
- mysqldump throws: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)
- How do I load a sql.gz file to my database? (importing)
- Uploading to WordPress Database