get USER ID in functions.php using user_register action
You are giving $wpdb->get_results a string for its second parameter. It should be a constant– ARRAY_N— meaning you need to remove the quotes $getunion = $wpdb->get_results( “SELECT value from wp_bp_xprofile_data where user_id = $getid AND field_id = 4”, ARRAY_N ); Since you claim it works in the second instance, I am assuming $wpdb compensates, but … Read more