title: mysql_real_escape_string causes problems?
body: <p>Okay. So I made a form. If I put in <code>mysql_real_escape_string</code> on my variable <code>$usrname</code> (yes its spelled right) that was retrieved from the form, it returns my other variable, <code>$verify</code> as <code>false</code>. Take a look:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;?php  
  
  session_start();
  
  include("mainmenu.php");  
  
  $usrname = $_POST['usrname']; 
  $password = sha1($_POST['password']);
  
  $con = mysql_connect("localhost", "root", "Y0U_C@NT_H@NDLE_THE_TRUTH!");
   if(!$con){
    die("Unable to establish connection with host. We apologize for any inconvienience.");
  }
  
  mysql_select_db("users", $con) or die("Can't connect to database.");
  
  $select = "SELECT * FROM `data` WHERE usrname = '$usrname' and
  password = '$password'";
  $query = mysql_query($select);
  $verify = mysql_num_rows($query);
  
  if($verify==1){
      $_SESSION["valid_user"] = $usrname;
      header("location:index.php");
  }
  else{
       echo "Wrong username or password. Please check that CAPS LOCK is off.";
       echo "&lt;br/&gt;";
       echo "&lt;a href=\"index.php\"&gt;Back to login&lt;/a&gt;";
  } 
  
  mysql_close($con);
  
  ?&gt; 
  &lt;/body&gt;
  </code></pre>
  
  <p>If I put the <code>mysql_real_escape_string</code> in either my registration form or login form, it returns <code>$verify</code> as <code>false</code>. What's wrong?</p>