PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
getClientDetails($clientSelectId);
$clientSelectedName=$clientDetailsResults['strClientName'];
function getClientDetails($clientId)
{
$clientDetails=mysql_query("SELECT * FROM tblClient WHERE intClientId='$clientId'");
$clientDetailsResults=mysql_fetch_array($clientDetails);
return $clientDetailsResults;
}
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!
Last edited by aceconcepts on Tue Mar 18, 2008 9:08 am, edited 1 time in total.
getClientDetails($clientSelectId);
$clientSelectedName=$clientDetailsResults['strClientName'];
function getClientDetails($clientId)
{
$clientDetails=mysql_query("SELECT * FROM tblClient WHERE intClientId='$clientId'");
$clientDetailsResults=mysql_fetch_array($clientDetails);
return $clientDetailsResults;
}
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!
The function is built correctly, but you are using it wrong.