using jquery post to send values to php file
<p>I'm trying to write a script in javascript/jquery that will send values to a php file that will then update the database. The problem is that the values aren't being read in by the PHP file, and I have no idea why. I hard-coded in values and that worked fine. Any ideas?</p>

<p>Here's the javascript:</p>

<pre><code>var hours = document.getElementById("hours");
var i = 1;
while(i &lt; numberofMembers) {        
    var memberID = document.getElementById("member"+i); 
    if(memberID &amp;&amp; memberID.checked) {
        var memberID = document.getElementById("member"+i).value;
        $.ajax({
            type : 'post',
            datatype: 'json',
            url : 'subtract.php',
            data : {hours : hours.value, memberID : memberID.value},
            success: function(response) {
                if(response == 'success') {
                    alert('Hours subtracted!');
                } else {
                    alert('Error!');
                }
            }
        }); 
    }
    i++;
}   
}    
</code></pre>

<p>subtract.php:</p>

<pre><code>if(!empty($_POST['hours']) AND !empty($_POST['memberID'])) {
    $hoursToSubtract = (int)$_POST['hours'];
    $studentIDString = (int)$_POST['memberID'];
}
$query = mysql_query("SELECT * FROM `user_trials` WHERE `studentid` = '$studentIDString' LIMIT 1");
</code></pre>

<p>Edit: Updated code following @Daedal's code. I'm still not able to get the data in the PHP, tried running FirePHP but all I got was "profile still running" and then nothing. </p>
