title: Querying more than one MySQL table and encoding the data as JSON
body: <p>I'll admit, I don't know tons about MySQL queries or JSON for that matter but I would like to. Currently when I get data from my database I query one table which brings values into another query and so on. I don't think this is the best practice to go about receiving all the data I need to display. Below is an example of how my MySQL queries currently work in a PHP foreach function:
  <img src="https://i.stack.imgur.com/QB1d8.jpg" alt="enter image description here"></p>
  
  <p>So, is there a better way of completing the query(s) I want and how would I be able to encode it as JSON?</p>
  
  <p>Any help would be appreciated, thank you.</p>