title: PHP mysql_num_rows() not working as expected
body: <p>I've got a mysql database with absolutely no values or rows, and when I call mysql_num_rows(), it returns like the table has got the row.</p>
  
  <p>I've tried everything I could thought about, but didn't work.
  I post the code:</p>
  
  <pre><code>function test_input($data){
              $data = trim($data);
              $data = stripslashes($data);
              $data = htmlspecialchars($data);
          }
  ...
  $name = test_input($_POST["name"]);
  $lname = test_input($_POST["lname"]);
  $email = test_input($_POST["email"]);
  $uname = test_input($_POST["uname"]);
  $password = test_input($_POST["password"]);
  $password = md5($password);
  
  $q2 = mysql_query("SELECT * FROM `users` WHERE `uname` = '$uname'");
  if(mysql_num_rows($q2) &gt; 0){
      echo "&lt;p&gt;Sorry, that username already exists&lt;/p&gt;";
  }
  ...
  </code></pre>