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
$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'")->fetchAssoc();