title: Fetch data from multiple MySQL tables
body: <p>My two tables look like this:</p>
  
  <pre><code>       TABLE1                      TABLE2
  +--------------------+      +--------------------+
  |field1|field2|field3|  and |field2|field4|field5|
  +--------------------+      +--------------------+
  </code></pre>
  
  <p>I am already running a SELECT query for TABLE1, and assorting all of the data into variables:</p>
  
  <pre><code>$query = "SELECT * FROM TABLE1 WHERE field2 = 2";
  $result = mysql_query($query);
  $num_rows = mysql_num_rows($result);    
    if((!is_bool($result) || $result) &amp;&amp; $num_rows) {
     while($row = mysql_fetch_array($result))
      {
     $field1 = $row['field1'];
     $field2 = $row['field2'];
     $field3 = $row['field3'];
      }
    }
  </code></pre>
  
  <p>What I want to do is get the data from 'field4' on TABLE2 and add it to my variables. I would want to get field4 WHERE field2 = 2 </p>