title: php mysql_fetch_assoc isn't working as expected
body: <p>Hello I have the following php code here:</p>
  
  <pre><code>    $username = trim(mysql_real_escape_string($username));
      $password = md5(trim(mysql_real_escape_string($password)));
      $query = "SELECT user_level FROM user WHERE username='$username' AND password='$password'";
      $result = mysql_query($query) or die('query did not go through');
      if($result!=false){
          echo 'result is not false!&lt;br/&gt;';
          while($row = mysql_fetch_assoc($result)){
          echo 'another output to test'.$row['user_level'].'&lt;br/&gt;';
          }
      }
  </code></pre>
  
  <p>I know the database entry exists.. its supposed to be '1' but for some reason it is not outputting 1. Am I missing something really small here that I just can't catch at this moment?</p>
  
  <p>edit: ok I've changed username to user_level but it is not getting anything. The echo in the while loop isn't even outputting anything.</p>
  
  <p>edit2: I also forgot to mention when I do output the $result it says resource id #5 so I know its getting something from the query.</p>
  
  <p>edit 3: (2/10/2012):Just to let you guys know, it was a mistake to get the username, I meant to get user_level from the user in the user table.</p>
  
  <p>the output for the query is:
  the query is this value SELECT user_level FROM user WHERE username='spankerer' AND password='246b8ae01899a116369ddcba84f425fd'</p>
  
  <p>print_r($row); is not being displayed in the while loop.</p>
  
  <p>edit 4: forgot to mention if I do the mysql query from the cmd, I get the table of user_level displaying 1 so it is correct.</p>