title: Cant see what is wrong with my script, seems to work on another site PHP login script
body: <p>This is my attempt at a basic mysqli php login script (im only learning, so please dont be too harsh).</p>
  
  <p>Can anyone see why it would be bringing up 0 rows every time and failing to login?</p>
  
  <pre><code>&lt;?php
  $con = mysqli_connect("localhost","user","pass","database");
  
  if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL, Please contact an Administrator";
  }
  
  $username = mysqli_real_escape_string($_POST['username']);
  $password = mysqli_real_escape_string($_POST['password']);  
  
  $query = "SELECT * FROM users WHERE user_name='$username' AND pass_phrase='$password'";
  
  $result = mysqli_query($con, $query);
  
  $row_cnt = mysqli_num_rows($result);
  
  if (!$row_cnt == 0) {
      echo "Usename/Password Combination Failed";
  } else {
      echo "Welcome " . $_POST['username'];
      }
  
  mysqli_close($con);
  ?&gt;
  </code></pre>