globally get any field value in user table of logged in user
- by Jugga
Im making a gaming community and i wanna be able to grab any info of the user on any page without so instead of having much of queries on all pages i made this function. Is it better to do this? Will this slow down the site?
/**
* ??????? ???????? ?? ????? ??????? authed ?????????????.
*/
function UserData($f)
{
global $_SESSION;
return mysql_result(mysql_query("SELECT `$f` FROM `users` WHERE `id` = ".intval($_SESSION['id'])), 0, $f);
}