title: Storing Arrays as PHP Session Variables
body: <p>My site has a list of users and each user is a member of different areas (groups, locations, etc). Instead of making a DB call every time I want to make a list, I want to store the array variables in session.</p>
  
  <pre><code>    //creates the array of groups that the user is in
      $_SESSION['gx']=mysql_query("SELECT * FROM `members` WHERE `user`='$user'");
  </code></pre>
  
  <p>Now my page loads and session_start() runs. However, when my page goes to retrieve that session variable, it's not there. Any suggestions?</p>
  
  <p>Thanks</p>