title: Mysql relationships and getting linked data
body: <p>I have been doing this for a while now, via some php, first lets say we have two tables:</p>
  
  <pre><code>Users
  user_id name email
  
  Images 
  image_id user_id url
  </code></pre>
  
  <p><code>user_id</code> and <code>user_id</code> from images table would be linked with a relationship.</p>
  
  <p>Now what I would do is select the user by their Id, check if the user is found, if so then make another query to images table, and check for num rows and loop through the return, is there a function that I could use that would allow me to just select the user and all the images that are linked to the user without doing a joint query.</p>
  
  <p>Thank you for any help</p>