Im trying to do the following:
But when i do this:
It comes out as blank...however. If i change:
To:
It outputs the id for testuser correctly.
If i just output $my->username (echo $my->username) it displays the currently logged in user as it should, but i dont know why its displaying nothing when i put it all together...
Have i got something wrong in this bit:::
??? Thanks for your help guys...
function getPunboUserID()
{
global $database;
$query = "SELECT id FROM site_forums_users "
."WHERE username='.$my->username.'";
$database->setQuery( $query );
$Itemid = $database->loadResult();
return $Itemid;
}
But when i do this:
echo getPunboUserID();
It comes out as blank...however. If i change:
."WHERE username='.$my->username.'";
To:
."WHERE username='testuser'";
It outputs the id for testuser correctly.
If i just output $my->username (echo $my->username) it displays the currently logged in user as it should, but i dont know why its displaying nothing when i put it all together...
Have i got something wrong in this bit:::
."WHERE username='.$my->username.'";
??? Thanks for your help guys...