I'm trying to get the first and last name values for ONE person in a database where the meet certain conditions of being a team leader and having a specific project id. Because of this, it will always be one row.
I have this
$leader_result = $wpdb->get_results("SELECT user_first_name, user_last_name FROM ".$wpdb->prefix."mro_attendees WHERE event_id = ".$project_id." AND user_role = 'team_leader' LIMIT 1");
But I'm not sure how to get the first and last names from they query. I tried setting up a while but when I did a test and echo'd the variables for the whiles I got nothing. What exactly am I doing wrong here? Is there something wrong with the WP query itself?
Tried with updates and still not getting information out of the echo.
$leader_result = $wpdb->get_results("SELECT user_first_name, user_last_name FROM ".$wpdb->prefix."mro_attendees WHERE event_id = ".$project_id." AND user_role = 'team_leader' LIMIT 0,1");
$leader_select = mysql_query($leader_result);
$row = mysql_fetch_row($leader_select);
$leader_first = $row[0];
If I echo $leader_first I get nothing as well.