title: PHP - Why while(mysql_fetch_array(mysql_query())) loops?
body: <p>So I have the code:</p>
  
  <pre><code>$sql = "SELECT * from users WHERE level = 2";
  $result = mysql_query($sql);
  while($write = mysql_fetch_array($result)){
      echo ''.$write['username'].'';
  }
  </code></pre>
  
  <p>I want to make it more simple so I do:</p>
  
  <pre><code>while($write = mysql_fetch_array(mysql_query("SELECT * from users WHERE level = 2"))){
  echo ''.$write['username'].'';
  }
  </code></pre>
  
  <p>Why the first code isn't infinity looping and the second code is?</p>