title: Querying a MySQL database to get values from another table
body: <p>I have two MySQL database tables:</p>
  
  <p>motorhome</p>
  
  <pre><code>-----------------------
  | id  | status | name |
  -----------------------
  |  1  | active | mh 1 |
  |  2  | active | mh 2 |
  -----------------------
  </code></pre>
  
  <p>motorhome_meta</p>
  
  <pre><code>----------------------------------------------
  | id  | motorhome_id | meta_key | meta_value |
  ----------------------------------------------
  |  1  | 1            | size     | large      |
  |  2  | 1            | fuel     | petrol     |
  |  3  | 2            | size     | small      |
  |  4  | 2            | fuel     | petrol     |
  ----------------------------------------------
  </code></pre>
  
  <p>What I need is a query that will allow me to select a row from the <code>motorhome</code> table, with the values from the <code>motorhome_meta</code> table. Or in other words if I was selecting the row in the 
  <code>motorhome</code> table with id 1. </p>
  
  <pre><code>----------------------------------------
  | id  | status | name | size  | fuel   |
  ----------------------------------------
  |  1  | active | mh 1 | large | petrol |
  ----------------------------------------
  </code></pre>
  
  <p>There are occasions where I might need to use a where statement against either table eg <code>WHERE motorhome.status='active'</code> or <code>WHERE motorhome_meta.meta_key='size'</code>.</p>