I want to have a function that is at the top of every page that gets the ‘uid’ from a session ansd querys it and sets $user_info = mysql_fetch_assoc(the query to get the user info), but its not working
We’d need more information on what exactly it is you need, but my first thought is that getting this same information on every page load may be overkill unless you expect the information to change constantly.
I would do the following on the top of every page:
[php]
session_start();
if (!isset($_SESSION[‘user_info’]))
{
// your code to get the user information
$_SESSION[‘user_info’] = $retrieved_data;
}
[/php]
That way, the information stays active and available until the users leaves the page for a specific time or until it times out.
Sounds like you may have the user id already in the session, so I’d just expand on that.
If that doesn’t help, I suggest you post a bit more information than one sentence