How to get ajax result in php I am using below code : when result exist its not going to if condition it will go to else.please any one help me.in query result $num>0 i want alert like.receipt number already exist 

    $.post("acceptajax.php?confirm1="+confirm+'&receipt='+receipt+'&amount='+amount,function(result,status){
      //$('#divsub'+confirm).html(data);
      if(result == 'exist'){
      alert('Receipt number Alerady Exit');
      }
      else {
      $('#accept_'+confirm).hide();
      $('#unaccept_' +confirm).show();
      }
      });
    
    
    acceptajax.php
    
    $img_id=$_GET['confirm1'];
     $receipt=$_GET['receipt'];
     $receipt='HYD'.$receipt;
     $amount=$_GET['amount'];
    $sql=mysql_query("SELECT receipt FROM user WHERE receipt=$receipt");
    $num=mysql_num_rows($sql);
    if($num==0){
    echo "suc";
    }
    else {
    echo "exist";
    }