I am trying to update a table when the page loads:
Here is the code:
<?php
mysql_select_db($database_connUserareas, $connUserareas);
$query = "SELECT TimesRead FROM bbmain WHERE bbKey = '$bbKey'";
$rsTotal= mysql_query($query, $connUserareas) or die(mysql_error());
$row_query = mysql_fetch_assoc($rsTotal);
$newTotal = $row_query['TimesRead'] + 1;
$sql_update = "UPDATE bbmain SET bbmain.TimesRead = '$newTotal' WHERE bbmain.bbKey = '$bbKey'";
?>
I have echoed $bbKey and $newTotal and I get the right results. But my table never updates. Please help.