Q:

PHP: call a string from another page function?

Can you do that? I just tried but it doesnt seem to work. 
I have dbc.php included at top of my page, and in dbc.php at the bottom i created this function:
function getUserInfo($id) {
$thaString = mysql_query("SELECT * FROM users WHERE id = '$id'");
$thaString2 = mysql_query("SELECT * FROM users_profile WHERE uID = '$id'");
$showUR = mysql_fetch_array($thaString);
$showURP = mysql_fetch_array($thaString2);
}

So it would be easier for me to call them instead of running the queries all the time when i need them in other pages.. 
But when i try to do:
getUserInfo($showInfo["bID"]);
echo $showUR["full_name"];

I dont get any result, is there a smarter way to do this, if so how?

A:

It's an issue of scope: $showUR is set inside getUserInfo(), so it's not available to the echo outside the function. There are lots of potential modifications you could make, but you may want to assign your values into an array and then return that array:
function getUserInfo($id) {
    $user = array();

    $thaString = mysql_query("SELECT * FROM users WHERE id = '$id'");
    $thaString2 = mysql_query("SELECT * FROM users_profile WHERE uID = '$id'");
    $user['showUR'] = mysql_fetch_array($thaString);
    $user['showURP'] = mysql_fetch_array($thaString2);

    return $user;
}

$user = getUserInfo($showInfo["bID"]);
echo $user['showUR']["full_name"];

