title: Only one query instead of two
body: <p>I have 2 tables, one is called <code>post</code> and one is called <code>followers</code>. Both tables have one row that is called <code>userID</code>. I want to show only posts from people that the person follows. I tried to use one MySQL query for that but it was not working at all. </p>
  
  <p>Right now, I'm using a workaround like this:</p>
  
  <pre><code>$getFollowing = mysqli_query($db, "SELECT * FROM followers WHERE userID = '$myuserID'");
  while($row = mysqli_fetch_object($getFollowing))
  {
      $FollowingArray[] = $row-&gt;followsID;
  }
      if (is_null($FollowingArray)) { 
      // not following someone
      } 
      else {
      $following = implode(',', $FollowingArray); 
      }
  
  
  $getPosts = mysqli_query($db, "SELECT * FROM posts WHERE userID IN($following) ORDER BY postDate DESC");
  </code></pre>
  
  <p>As you might imagine im trying to make only one call to the database. So instead of making a call to receive <code>$following</code> as an array, I want to put it all in one query. Is that possible?</p>