I want to get the first_name and the last_name from a database.
I select them, but then I'm unable to return both with a space in-between them, and need it to be returned not echoed because I am going to use it as a link for the user profile.
function getuser ($id, $field_one, $field_two) {
$query = mysql_query("SELECT $field_one, $field_two FROM users WHERE user_id='$id'");
$run = mysql_fetch_array($query);
return $run[$field_one, $field_two];
}
I think the problem is in the last 2 lines
$run = mysql_fetch_array($query);
return $run[$field_one];