What is wrong with this code ? When I refresh the page, I want it to get the currenet number of hits, add one, and then update the datebase...
<?PHP
include ('access.php');
$db = mysql_connect("localhost", "$user", "$pass");
mysql_select_db("network",$db);
$result = mysql_query("SELECT * FROM network_hits",$db);
while ($row = mysql_fetch_array($result))
{
$cur_hit_num = ($row ["hits"]);
echo $cur_hit_num;
$new_hit_num = ($row["hits"] + 1);
echo $new_hit_num;
$sql = "UPDATE network_hits SET hits='$new_hit_num WHERE hits IS '$cur_hit_num'";
mysql_query($sql);
}
?>