Get profile2 fields based on user I am trying to retrieve some fields from my Profile 2 profile but am not sure how I should connect the table dr_field_data_field_resources to its relevant user.

In profile it is possible to add a field term_reference 'resources', then I want to be able to retrieve those values in an array based on a user I specify. I did see some other docs for profile2_load, but I using an example turorial. I am getting called to undefined function for profile2_load().

$userskillsresources = db_query("SELECT dr_users.name as 'username', dr_taxonomy_term_data.name  as 'userresourceterm'
    FROM dr_users
    JOIN dr_field_data_field_resources
    JOIN dr_profile ON dr_users.uid = dr_profile.uid
    JOIN dr_taxonomy_term_data ON dr_field_data_field_resources.field_resources_tid = dr_taxonomy_term_data.tid
    WHERE dr_users.uid = '10'")-&gt;fetchAssoc();
If you really do have Profile2 installed and enabled, then you shouldn't get getting undefined function errors.  Double check that it is enabled.

Otherwise, you are going about this in the wrong way.  You really don't need to do queries like this.  Leverage the API:

$account = user_load(10);
$profile = profile2_load_by_user($account);


If you have a single profile for the user, $profile will be a node object.  Otherwise, it will be an array of nodes.  Then you can do something like:

$resources = field_get_items('node', $profile, 'field_resources', $profile-&gt;language);


Also take a look at this article for a handy helper function or read more about the Field API.  If $resources are taxonomy terms, then take a look at taxonomy_term_load for loading the associated terms.