title: Get posts from deleted users SQL function
body: <p>Hello I am quite new in Sql and I am remaking one simple PHP dashboard. I have mysql database and I have problem with this query.</p>
  
  <pre><code>public function get_posts($thread_id, $start, $limit)
      {
          $sql = "SELECT a.*, b.username, b.id as user_id FROM ".TBL_POSTS." a, ".TBL_USERS." b 
                  WHERE a.thread_id = ".$thread_id." AND a.author_id = b.id 
                  ORDER BY a.date_add ASC LIMIT ".$start.", ".$limit;
          return $this-&gt;db-&gt;query($sql)-&gt;result();
  </code></pre>
  
  <p>The situation which can happen is that a.author id is not equal to b.id because user was deleted. I need to improve my sql to show posts of deleted users and show some information that post is by deleted user.</p>
  
  <p>Thank you</p>