Pass test score results to mysql query
<p>I have been putting a quiz together with jQuiz: <a href="http://www.fatihacet.com/lab/jQuiz/" rel="nofollow">http://www.fatihacet.com/lab/jQuiz/</a></p>

<p>If you take the test you will see it shows your score at the end in the format of 90/100 (it only has four questions).</p>

<p>How would you pass the score the user got to a variable to then perform a sql and IF statement?</p>

<p>in the jQuiz.js file it has the following code at the bottom:</p>

<pre><code> $('.btnShowResult').click(function(){
            $('#progress').width(300);
            $('#progressKeeper').hide();
            var results = jQuiz.checkAnswers();
            var resultSet = '';
            var trueCount = 0;
            for (var i = 0, ii = results.length; i &lt; ii; i++){
                if (results[i] == true) trueCount++;
                resultSet += '&lt;div&gt; Question ' + (i + 1) + ' is ' + results[i] + '&lt;/div&gt;'
            }
            resultSet += '&lt;div class="totalScore"&gt;Your total score is ' + trueCount * 20 + ' / 100&lt;/div&gt;'
            $('#resultKeeper').html(resultSet).show();
        })
</code></pre>

<p>I tried </p>

<pre><code>$Count = var results;

if($Count &gt;= "90")
{
   $award = $db-&gt;exec("UPDATE users SET test='passed' WHERE username='$username'");
} 
</code></pre>

<p>I feel I have the right idea but am just missing something crucial as it is not working or doing anything. Thanks for any direction or help you can give me. </p>
