Updating MySQL and returning value with jQuery

I’m so lost here. Any help is greatly appreciated. I have the following php in a seperate file:

 if($_POST['firm'] == "frompdc"){
  IF($_POST['frompdc'] <> $_POST['topdc'])
  {
   mysql_query("UPDATE TBLTRANSFERS SET FROMPDC = ".$_POST['frompdc'].", MOD_TS = '". $timenow ."' WHERE ID = ".$_POST['id']); 
  }ELSE{
   ECHO "Can't be the same";   
  }
 }

and my jQuery looks like:

 $("#frompdc<?php echo $JavaCnt;?>").change(function(){
 var id     = $('#id<?php echo $JavaCnt;?>').attr('value');
 var frompdc     = $('#frompdc<?php echo $JavaCnt;?>').attr('value');
 var topdc     = $('#topdc<?php echo $JavaCnt;?>').attr('value');  
  $.ajax({
   type: "POST",
   url: "AJ_Update.php",
   data: "firm=frompdc&id="+ id + "&frompdc=" + frompdc + "&topdc=" + topdc,
   success: function(data, frompdc) {
    if(data){
     alert(data) 
     }
   }
  });  
 return false;
 }
 );

I’m trying to get the success portion of this to work out where if my frompdc and my topdc are the same php will do nothing and jQuery will return an alert window that says what was echoed in php. Is this possible? I’m having the hardest time with this. Right now it returns the values of the echo of php with no problems but it returns a blank alert box when frompdc and topdc are not the same and I can’t figure out why…

thanks in advance!