title: num_rows keeps returning a null
body: <p>I honestly can't see why this doesn't work. I have checked it several times even compared it to other examples I have done that does work. Please note that I have taken it down to the simplest form so there is no sql injection protection. That comes later.</p>
  
  <pre><code>//user real escape string to prevent SQL injection
  $username = $_POST['username'];
  $password = $_POST['password'];
  
  //check if username and password is blank
  if (!$username || !$password)
      die ("Not all the fields were filled in");
  
  //Server details
  $host = 'localhost';
  $user = 'tm_user';
  $password = 'password';
  
  //The database name
  $database = 'TransportMe';
  
  // Create connection
  $con = new mysqli($host, $user, $password, $database);
  
  // Check connection
  if ($con-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  //since user and password is not blank, find user info using the email and password entered by user
  $sql= "SELECT * FROM Users WHERE 'email'='$username' AND 'password' = '$password';";
  
  //Get the results
  $result = $con-&gt;query($sql);
  
  //Check if null
  if ($result-&gt;num_rows == null)
      die("Null");
  </code></pre>