Previously, i was using PHP 5.6.3 with sqlsrv on IIS 7.5 on windows 7 and PHP was working fine with ajax success. I upgraded to Windows 10 and when i try to echo a string, a character is found attached to the string in ajax function. Please I want to know what is causing that.
PHP
$params=array($_POST['uID']);
$sql="SELECT * FROM users WHERE uID=?";
$stmt=sqlsrv_query($conn,$sql,$params);
if(!$stmt)
{
echo "1";
}
else
{
$row=sqlsrv_fetch_array($stmt);
if($row>0)
{
echo "1";
}
else
{
echo "0";
}
}
AJAX
var uID=$('#fUID').val();
$.ajax(
{
type:"POST",
url:"adminDB.php",
data:"uID="+uID+"&action="+action,
cache:true,
success:function(msg)
{
alert(msg);
}
});
OUTPUT: