title: How to use header while using AJAX?
body: <p>I have my login page where i need to check whether that username and password exists in my database or not
  So i have fired select query where username and password is entered by the user.
  Now I want is when there are no rows in result that means Username or Password is incorrect.</p>
  
  <p>This header method is not working.What i need to do?</p>
  
  <pre><code>$sql="SELECT * FROM login WHERE username='$username' and password='$password'";
  $result=mysqli_query($con,$sql);
  
  $count=mysqli_num_rows($result);
  if($count==0)
  {
  echo "Login Failed: Please Try Again";
  }
  if($count==1)
  {
  header('Location:something.php');
  }
  </code></pre>