title: echo not working for an ajax call which doesn't refresh the page
body: <p>I am trying to implement a simple javascript program in which I am making an ajax call to a php script. I make sure that the page is not getting refreshed on its own.So,now if I am using echo functions in php then it is not working.</p>
  
  <pre><code>    $("#check").on('click',function(){
          //alert("hello");
          var user_name=document.getElementById("user_name").value;
          var pwd=document.getElementById("pwd").value;
  
          $.ajax({
              url:'checkUser.php',
              type:'POST',
              data:{
                  user_name:user_name,
                  pwd:pwd
              },
              success:function(){
                  alert("hello"); //This section works fine so the php file is getting called
              }
          });
  
  return false;
  
  })
  </code></pre>
  
  <p>checkUser.php</p>
  
  <pre><code>&lt;?php require 'database.php';
  if($conn-&gt;connect_error){
      die("Connection failed: " . $conn-&gt;connect_error);
  }
  //Database is getting connected properly
  $user_name=$_POST['user_name'];
  $password=$_POST['pwd'];
  echo("&lt;script&gt;console.log('PHP:');&lt;/script&gt;"); //not getting displayed on console
  $sql="Select * from login where User_name='$user_name' and Password='$password'";
  $result=mysql_query($sql);
  $count=mysql_num_rows($result);
  echo $count; //not getting displayed on console
   ?&gt;
  </code></pre>
  
  <p>If I want to use an echo function, then how should I do it?Thanks!</p>