title: mysql_num_rows() expects parameter 1 to be resource, string given in
body: <p>I have read through many other threads about this exact problem, but i for some reason can not solve my problem. Really need some help. </p>
  
  <pre><code>if (!$username||!$password||!$email)
      echo "Please fill out all fields"; 
   else
   {
      //encrypt password
      $password = md5($password);
  
      //check if username already taken
      $check = mysql_query("SELECT * FROM Test WHERE username = '$username'");
      if (mysql_num_rows($check)&gt;=1)
         echo "Username already taken";
  
      else
  </code></pre>
  
  <p>It said </p>
  
  <blockquote>
    <p>Warning: mysql_num_rows() expects parameter 1 to be resource, string
    given in /Users.....</p>
  </blockquote>
  
  <p><code>if (mysql_num_rows($check)&gt;=1)</code> This line..but when i run it in phpmyadmin, it returns results to me ok. </p>
  
  <p>Please help</p>