title: How can I get data from multiple mysql tables and store in user session?
body: <p>I have two mysql tables: USER and ROSTER. Previously, I've been able to query and retrieve the proper student and direct the user to the proper page. Moving forward, I'd like to query the tables and retrieve the users studentID, name, period, and access. </p>
  
  <p><strong>USER</strong>
  <br />studentID<br />
  name<br />
  access</p>
  
  <p><strong>ROSTER</strong><br />
      id<br />
      period</p>
  
  <pre><code>    $studentID = $_POST['studentID'];
  
      $studentID = stripslashes($studentID);
  
      $studentID = mysql_real_escape_string($studentID);
      $getUser_sql = "SELECT * FROM USER, ROSTER WHERE USER.studentID='$studentID'";
      $getUser = mysql_query($getUser_sql);
  
      $getUser_result = mysql_fetch_assoc($getUser);
  
      $getUser_RecordCount = mysql_num_rows($getUser);
  
      if($getUser_RecordCount==1){
  
  
  
         session_start();
         $_SESSION['loggedin'] = TRUE;
         $_SESSION['studentID'] = $studentID;
  
  
      header("location:login_success.php");
  
      }
  </code></pre>
  
  <p>What am I doing wrong? I've looked at examples @<a href="http://www.tizag.com/mysqlTutorial/mysqljoins.php" rel="nofollow">tizag</a> and @<a href="http://dev.mysql.com/doc/refman/5.0/en/multiple-tables.html" rel="nofollow">mysql</a>, but I just can't get this going. </p>