title: MySql query using two tables with Inner join (i think)
body: <p>I'm trying to get this query to work, I just want to display record where Physio Reference (from table 1) equals <code>SESS_MEMBER_ID</code> (from a members table in MySQL but is from a session created from login).</p>
  
  <p>I'm not sure exactly how to do this as I'm still grasping the concept of php. I'm not sure if you have to put some code at the end to tell it that the field is from the table <code>members</code>.</p>
  
  <p>my aim is to only display records from the IA tables PhysioReference field, where that fields equals the SESS_MEMBER_ID kept in the session from the members table.</p>
  
  <pre><code>$sql="SELECT * 
        FROM IA tb1, members tb2 
        WHERE tb1.PhysioReference=tb2.member_id
        AND tb2.member_id=SESS_MEMBER_ID";
  $result=mysql_query($sql);
  </code></pre>
  
  <p><strong>Members</strong> - table name</p>
  
  <blockquote>
    <p>member_id,    firstname,  lastname,   login,  passwd,</p>
  </blockquote>
  
  <p><strong>IA</strong> - table name</p>
  
  <blockquote>
    <p>Reference,  Forename,   Surname,    DOB,    PhysioReference,</p>
  </blockquote>
  
  <p>Thanks in advance</p>