title: Mysqli Get Information from two different tables
body: <p>I have two different tables one hold comments and the other user information my first mysqli_prepare statement looks like this</p>
  
  <pre><code>    if($stmt = mysqli_prepare($mysqli, "SELECT text,username,id,likes,dislikes FROM post WHERE school = '$sname' ORDER BY id DESC LIMIT 0,10"))
  </code></pre>
  
  <p>and the other looks like this </p>
  
  <pre><code>   if($stmts = mysqli_prepare($mysqli, "SELECT avatar FROM users WHERE username = '$user'"))
  </code></pre>
  
  <p>basically i need to combine these two statements so that I can access both sets in the same while loop which looks like this </p>
  
  <pre><code>    while(mysqli_stmt_fetch($stmt))
  </code></pre>
  
  <p>any help is appreciated thank you in advance and I will vote up.</p>