I am trying to add code to bottom of webpage that will update mysql database with each new visitor. I have set up a mysql DB with table named 'webpage' and column 101 is called 'count'.
Each row in the table is a different webpage ($id=1508)
I am not sure why the below code will not increment the 'count' column for $id=1508 by 1. Please help.
<?php
$id = '1508';
$DBhost = 'address';
$DBuser = 'user';
$DBpass = 'pass';
$DBName = 'name';
mysql_connect($DBhost,$DBuser,$DBpass) or die('Unable to connect to database');
@mysql_select_db('$DBName') or die('Unable to select database $DBName');
$sqlquery = '(UPDATE webpage SET count=(count+1) where id=$id');
mysql_close();"
?>