Hello,
I have an article tracker that increments the number of hits an article receives as follows
<?php
// Open a database connection (Update these with your own DB server info)
mysql_pconnect($_SESSION['MYSQL_SERVER1'],$_SESSION['MYSQL_LOGIN1'],$_SESSION['MYSQL_PASS1'])
or die("Unable to connect to SQL server");
mysql_select_db($_SESSION['MYSQL_DB1']) or die("Unable to select database");
$SQLII = "update articles set hits = hits + 1 where url = '".$_SERVER['REQUEST_URI']."'";
$result = mysql_query($SQLII) or die("Invalid query (login): " . mysql_error());
echo "<br>SQL STATEMENT:<br>".$SQLII."<br><br>";
?>
The tracker works fine if I view the page opened in my browser. However, if I select the page by clicking a link the "Hits" column increments twice. Any suggestions?
Regards,
Tom