title: Whats wrong with mysql_num_rows? It is Returning errors
body: <p>I used this series and I'm up to this video and <code>mysql_num_rows</code> has been pissing me off ever since the start.
  <a href="http://www.youtube.com/watch?v=HP75yyjHgTg" rel="nofollow">http://www.youtube.com/watch?v=HP75yyjHgTg</a>
  i have easily spent 5 hours simply trying to fix all these <code>mysql_num_rows</code> errors.
  At the Moment I'm doing profile page and I'm getting an error.
  The Error is: </p>
  
  <blockquote>
    <p>Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /home/ztechrel/public_html/TESTING/blarg/REMAKE/profile.php on line 8 (line one is the mysql_num_rows part)</p>
  </blockquote>
  
  <p>The Code in profile.php is:</p>
  
  <pre><code>&lt;?php include("inc/incfiles/header.php"); ?&gt;
  &lt;?php
  if(isset($_GET['u'])) {
      $username = mysql_real_escape_string($_GET['u']);
  
      if(ctype_alnum($username))   //check user exists
          $check = mysql_query("SELECT username,first_name FROM users WHERE username='$username'");
  
      if(mysql_num_rows($check)===1) 
      {
          $get = mysql_fetch_assoc($check);
          $username = $get['username'];
          $firstname = $get['first_name'];
      }
      else
      {
          echo "&lt;h2&gt;User Does Not Exist&lt;/h2&gt;";
          exit();
      }
  }
  ?&gt;
  </code></pre>
  
  <p>is there a way i can fix this?
  Or does anyone know another way i can write this?
  I wouldn't be surprised he uses <code>mysql_num_rows</code> again, is there something i can use instead which is easy to implement?
  If you need any other info just ask.</p>