simple hit counter will not show values
Posted: Thu Feb 12, 2004 9:08 am
hi this simple hit counter will not show values and be assured the database does exist with the correct permissions and the table exist as well as the data which starts at 1. please any advice!
<?
$dbconnect= mysql_pconnect("xxxxxxxx", "xxxxx", "xxxxxxxx")or die(mysql_error());
mysql_select_db("counter", $dbconnect) or die(mysql_error());
$query = "Update countertable SET count = 'count + 1' WHERE 'PHP_SELF'";
mysql_query($query)or die(mysql_error());
$queryfrom = "SELECT count from countertable";
$row=mysql_query($queryfrom) or die(mysql_error());
mysql_fetch_row($row);
$count2 = $row['count'];
echo "You are visitor #$count2";
mysql_close($dbconnect);
?>
<?
$dbconnect= mysql_pconnect("xxxxxxxx", "xxxxx", "xxxxxxxx")or die(mysql_error());
mysql_select_db("counter", $dbconnect) or die(mysql_error());
$query = "Update countertable SET count = 'count + 1' WHERE 'PHP_SELF'";
mysql_query($query)or die(mysql_error());
$queryfrom = "SELECT count from countertable";
$row=mysql_query($queryfrom) or die(mysql_error());
mysql_fetch_row($row);
$count2 = $row['count'];
echo "You are visitor #$count2";
mysql_close($dbconnect);
?>