title: select multiple values from one condition (PHP/MySQL)
body: <p>I have a table which holds details of exams taken. Each exam entered into this table is entered as a pair of people i.e. two people per exam performed so you have per exam, two people. Each person has their own unique id for each exam taken but each pair has a value called partner_id which is the same for them both.</p>
  
  <p>What I am trying to do is extract the partner_id values from that table in order to then be able to use those values to find the partners of a said person and show/echo onto the page the exam result details of every partner that person has had exam with.</p>
  
  <p>What I have tried so far is:</p>
  
  <pre><code>$partner_ider = mysql_query("SELECT partner_id as value1 from exam WHERE Student_email='eating@gnomes.com'");
  $row1 = mysql_fetch_array($partner_ider);
  
  while($row1 = mysql_fetch_array($partner_ider))
  {
      echo $row1['value1'];
  }
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>$result = mysql_query("SELECT * from exam WHERE Student_email='beating@dead.com'");
  $row = mysql_fetch_array($result);
  
  while ($row = mysql_fetch_array($result))
  {
      echo $row['partner_id'];
  }
  </code></pre>
  
  <p>The result these would give is 2 for that email of which has two entries in the exam table, what I was looking for was 1, 2 which are the values of the two partner_ids for this email's exam records. When I change the email to someone else who only has one, it returns nothing.</p>
  
  <p>What I would be looking to do with the result of 1, 2 is to use those values to select all other people except the original person(eating@gnomes.com) and show their details from out of that table.</p>
  
  <p>What I'm asking for is how would I go about doing the above as I haven't done something like this before?</p>