PHP updating value in table from array
<p>I am trying to update a value in a table I get from an array.  I'm not getting any errors but it is not updating my table ex_test_setting.  What am I doing wrong?  I followed other posts and googled it but I cant get a correct answer.</p>

<pre><code>echo "&lt;strong&gt;Checking if the test points changed&lt;/strong&gt;";
echo "&lt;/BR&gt;";
$getTotalPoints = mysql_query("SELECT SUM(points_available) FROM ex_question WHERE test_name = '$tid_mod1'") or die(mysql_error()); 
$totalPoints = mysql_fetch_array($getTotalPoints);
echo "New points for test: " . $totalPoints['SUM(points_available)'];
echo "&lt;/BR&gt;";

$sql2="SELECT DISTINCT point FROM ex_test_setting WHERE testid = '$tid_mod1'";
$res2=mysql_query($sql2);
while($row2 = mysql_fetch_array($res2)) {
$point1=$row2['point'];
echo "Old points for test: " . $point1;
echo "&lt;/BR&gt;";
}


if ($totalPoints['SUM(points_available)'] &lt;&gt; $point1) {
echo "Updating...";
$newpoint = $totalPoints['SUM(points_available)'];
echo $newpoint;
mysql_query("UPDATE ex_test_setting SET point = '$newpoint' WHERE test_name = '$tid_mod1'");
}
</code></pre>
