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);
}