I want to increase "hit" by 1 but this code cannot update the "hit".
<?php
include "config.php";
$sitename = $HTTP_GET_VARS['site'];
/* Connect to the MySQL database */
$db_connection = mysql_connect($host, $database, $pass) //database name & password must be changed
or die("Could not connect to DB");
/* Select the NepaliDate database */
mysql_select_db ($database, $db_connection) //changed the database name
or die("Could not find DB");
$strSQL = "select hit from SiteSubmit where homepage ='$sitename'" ;
/* Get the data from the database */
$query_result = mysql_query ($strSQL, $db_connection);
$resrow = mysql_fetch_row($query_result);
$hit = $resrow[0];
$hit = $hit + 1;
$strSQL = "update sitesubmit set hit=$hit where homepage='$sitename'";
$query = mysql_query($strSQL, $db_connection) or die ("Failed : $strSQL");
if ($query=success) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=$sitename\">";
}
/* Close the connection with the database */
mysql_close($db_connection);
?>