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>