用PHP和Jquery替换Span数据

Im trying to do a simple span replacement using Jquery, php, and SQL. I think i coded this right but nothing is being displayed. I am using jQuery instead of $ to note the code to not collide with another script being used. How can i fix this:

jQuery:

jQuery.ajax({
    type: "POST",
    url: "http://www.mysite.com/report/reportScripts/getData.php",
    data: "&id=<?php echo $_GET['repId']; ?>",
    dataType: 'html';
    success: function(data){
        jQuery('.msgbox').html(response);
    }
}); 

PHP:

$con = mysql_connect('localhost', '****', '****');

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("*****", $con);

$sql="SELECT * FROM report_ordered WHERE referenceNum = '".$repId."'";

$result = mysql_query($sql);
$row = mysql_fetch_array($result);

echo $row['name'];

HTML Span:

<span id="msgbox"></span>

1. Success returns html in data, but you use response?

success: function(data){
    jQuery('.msgbox').html(data); # you used response 
}

2. You use className to find msgbox, but msgbox has id

success: function(data){
    jQuery('#msgbox').html(data); # you used .msgbox
}

3 . Use object as data: input in ajax

data: { id: <?php echo $_GET['repId']; ?> },

4. How do you fetch $repId? I hope you have some validation ?

$sql="SELECT * FROM report_ordered WHERE referenceNum = '".$repId."'";

Your span has an id, not a class - refer to it as:

jQuery('#msgbox').html(response);

EDIT - as Johan pointed in above comment, if you define your success callback as function(data){ ... }, you have to refer to data and not to response of course.

Check your developer tools for this kind of errors.