title: How to select data from two tables using a single query
body: <p>I've been trying to get my head around how to use a single query to select data from two of my tables. If anybody can suggest a better way than a single query, I'm all ears! Previously I would do this using two queries which I could make work easily although I'm led to believe that a single query would be better, hence trying to learn.</p>
  
  <p>One of my tables resembles this in a cut down form. Call this table "member": <br></p>
  
  <pre><code>ID  |  firstName  |   lastName  | networkingID
  </code></pre>
  
  <p>And the other table which I'll call "networking": <br> </p>
  
  <pre><code>ID  |  websiteURL | facebookURL | twitterURL
  </code></pre>
  
  <p><br>
  What I'm trying to do is run a query on the table <code>member</code> like:</p>
  
  <pre><code>SELECT * FROM `member` WHERE `ID`=2
  </code></pre>
  
  <p>Which returns the data from the table <code>member</code>.</p>
  
  <p>However I also wish to return the relating value from the table <code>networking</code>. The column <code>networkingID</code> in the table <code>member</code> is the <code>ID</code> of the row in <code>networking</code>.</p>
  
  <p>How would I go about doing this?</p>
  
  <p>So far, I have experimented using all of the JOINs that I was able to find through Google but I am unable to make it work. My best result was with a <code>LEFT JOIN</code> where all of the columns were present but the results from the networking table were all <code>NULL</code>.</p>