title: How to get data from 2 tables?
body: <p>I am trying to create a website with an existing database.
  The database has two tables, one of them contain the post info like title, id, content, etc etc,
  the other table contains the post ID and the post category.</p>
  
  <p>For example: I want to take a post from a specific category.</p>
  
  <pre><code>$sql = 'SELECT * FROM posts WHERE status = "publish" ORDER BY date DESC LIMIT 10';
  </code></pre>
  
  <p>This is a simple function, can some one help me please how to modify it, to get the category from the other table and the post info from the other table.</p>