Using a function return value [SOLVED]
Posted: Tue Mar 18, 2008 8:56 am
Hi,
Forgive this lame post -
How do I use the return value from a function?
e.g.
So basically what I'm trying to do is get a value from a database using an id variable passed via the function paramaters.
I must be doing something wrond because when I output $clientSelectedName nothing is displayed!
Forgive this lame post -
How do I use the return value from a function?
e.g.
Code: Select all
getClientDetails($clientSelectId);
$clientSelectedName=$clientDetailsResults['strClientName'];
function getClientDetails($clientId)
{
$clientDetails=mysql_query("SELECT * FROM tblClient WHERE intClientId='$clientId'");
$clientDetailsResults=mysql_fetch_array($clientDetails);
return $clientDetailsResults;
}I must be doing something wrond because when I output $clientSelectedName nothing is displayed!