getting number from php file with jquery ajax
<p>I'm new to AJAX and j Query.  I'm trying to pass a number from unrate.php to be used as checkVal (as shown below).  The file does a bunch of stuff but it only echos the number.  When I add a alert(checkVal) it shows a invalid character and than the number I want. (I just want the number)... Thanks in advanced for your help!  </p>

<h2>ajax handler:</h2>

<pre><code>$.get("unrate.php?numb="+ID, function(checkVal){
  if (checkVal == 1) {
    number.innerHTML = addNumb + 1;
  } else { 
    number.innerHTML = addNumb - 1;
  }
});
</code></pre>

<h2>unrate.php:</h2>

<pre class="lang-php prettyprint-override"><code>&lt;?php
$uNum = $_SESSION['userNum'];
$ider = $_GET['numb'];
$sql = mysql_query("SELECT * FROM ratecheck WHERE ID =".$ider);
$checkRay = mysql_fetch_array($sql);
$checkVal = $checkRay[$uNum];

$sqlZ = mysql_query("UPDATE ratecheck SET `".$uNum."`=0 WHERE ID=".$ider)
or die(mysql_error());

    $sqlB = mysql_query("SELECT * FROM sources WHERE ID =".$ider);
    $sourceRay = mysql_fetch_array($sqlB);
    $newRC = $sourceRay['ratecount'] - 1;

    mysql_query("UPDATE sources SET ratecount =".$newRC." WHERE ID =".$ider)
    or die(mysql_error());

if ($checkVal &gt; 1)
    {   
    $newpts = $sourceRay['points'] - 1; 
    $userEmail = $sourceRay['user'];

    mysql_query("UPDATE sources SET points =".$newpts." WHERE ID =".$ider)
    or die(mysql_error());  

        if ($_SESSION['userName']) 
        {
            $findUser = mysql_query("SELECT * FROM users WHERE email LIKE '".$userEmail."'") or mysql_error();
            $currentRate = mysql_fetch_array($findUser);
            $newrating = $currentRate['rating'] - 1;
            mysql_query("UPDATE users SET rating =".$newrating." WHERE email LIKE '".$userEmail."'")
            or mysql_error();      

        }
        else
        {
            die('ERROR');
        }
    }
else 
    {
    $newpts = $sourceRay['points'] + 1; 
    $userEmail = $sourceRay['user'];


    mysql_query("UPDATE sources SET points =".$newpts." WHERE ID =".$ider)
    or die(mysql_error());

        if ($_SESSION['userName']) 
        {
            $findUser = mysql_query("SELECT * FROM users WHERE email LIKE '".$userEmail."'") or mysql_error();
            $currentRate = mysql_fetch_array($findUser);
            $newrating = $currentRate['rating'] + 1;
            mysql_query("UPDATE users SET rating =".$newrating." WHERE email LIKE '".$userEmail."'")
            or mysql_error();      

        }
        else
        {
            die('ERROR');
        }
    }
echo $checkVal;
mysql_close(); 
?&gt;
</code></pre>
