Title: Get profile field value
Last modified: May 20, 2017

---

# Get profile field value

 *  Resolved [jaykdoe](https://wordpress.org/support/users/jaykdoe/)
 * (@jaykdoe)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/get-profile-field-value/)
 * Hi,
 * How can I get a profile field value to either display in a page template or echo
   as a php variable.
 * I am trying to grab it directly from the database in a php file like this
 * $array = $mysqli->query(
 * “Select meta_value FROM `wp_usermeta` WHERE `meta_key` = `xapo_address` AND `
   user_id` = “.$subid.””
    );
 * But I get the following error in my script
    Warning: mysql_fetch_assoc() expects
   parameter 1 to be resource, boolean given
 * And when I try to execute the SQL query in the database like this
    Select meta_value
   FROM `wp_usermeta` WHERE `meta_key` = `field_name` AND `user_id` = “1”
 * I get this error
    #1054 – Unknown column ‘field_value’ in ‘where clause’
 * I don’t have any other idea how to pull the custom field value to use in a template,
   script, or even just for display.
 * Any help would be amazing, as this is the last thing I need!
    -  This topic was modified 9 years, 2 months ago by [jaykdoe](https://wordpress.org/support/users/jaykdoe/).

Viewing 1 replies (of 1 total)

 *  [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * (@teodor-cosofret)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/get-profile-field-value/#post-9155712)
 * Hi,
 * My suggestion would be to use the [get_user_meta()](https://codex.wordpress.org/Function_Reference/get_user_meta)
   function.
 * Best regards,

Viewing 1 replies (of 1 total)

The topic ‘Get profile field value’ is closed to new replies.

 * ![](https://ps.w.org/profile-builder/assets/icon-256x256.png?rev=2961144)
 * [User Profile Builder - Beautiful User Registration Forms, User Profiles & User Role Editor](https://wordpress.org/plugins/profile-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/profile-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/profile-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/profile-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/profile-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/profile-builder/reviews/)

## Tags

 * [display](https://wordpress.org/support/topic-tag/display/)
 * [field value](https://wordpress.org/support/topic-tag/field-value/)
 * [get](https://wordpress.org/support/topic-tag/get/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [print](https://wordpress.org/support/topic-tag/print/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * 1 reply
 * 2 participants
 * Last reply from: [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/get-profile-field-value/#post-9155712)
 * Status: resolved