title: php: for each record in one mysql table, display all the records from a 2nd table
body: <p>I have 2 tables, one with email addresses, and one with a number of rows per email address:</p>
  
  <pre><code>Table 1:
  1@gmail.com
  2@gmail.com
  etc
  
  Table 2:
  1@gmail.com,value111,value112,value113
  1@gmail.com,value121,value122,value123
  2@gmail.com,value211,value212,value213
  etc.
  </code></pre>
  
  <p>I want to send each of the email addresses their values, so I get the email:</p>
  
  <pre><code>$query = "SELECT email FROM email_table";
  $result = mysql_query($query) or die(mysql_error());
  while($row = mysql_fetch_array($result)){
  $email = $row['email'];
  </code></pre>
  
  <p>and then, I need to get the values for each email.
  I tried using foreach but apparently not in a correct way
  Can anybody help?</p>
  
  <p>Many thanks!</p>