title: MySQL Selecting data from multiple different tables in a single query
body: <p>I have a database of users where I have a primary table with name, address etc. I then have separate tables for the users children, pets, training courses and education results etc.</p>
  
  <p>This users details can all be displayed on the same page and the way I currently do it is by first querying the database for the users main details. Then I query the other tables individually and display this information with loops.</p>
  
  <p>I really just need to know if this is the best way to do it or whether there is a way of doing it with a single query and if there is any advantage?</p>
  
  <p>The basic structure of the tables is:</p>
  
  <pre><code>+----------------+    +-----------------------+
  | Users          |    | Children              |
  +----------------+    +-----------------------+
  |ID |Name |Age   |    |ID |UserRef |Name |Age |
  +----------------+    +-----------------------+
  |1  |Jim  |53    |    |1  |1       |Joe  |11  |
  |2  |Karl |37    |    |2  |1       |Jane |9   |
  +----------------+    |3  |2       |Amy  |15  |
                        +-----------------------+
  </code></pre>
  
  <p>This is a basic version and only shows the user and children table. The other tables are similar to the children table in that they reference the user table and feature multiple records for a single user.</p>
  
  <p>Thanks in advance.</p>