<?php
require_once('config/config.php');
require_once(CLASS_DIR.'dbClass.php');
$obj = new DBClass();
$sql = "SELECT * FROM ".TBL_HITCOUNTER." WHERE page_name = '".$pageName."'";
$rs = $obj->executeQry($sql,$link);
$row = $obj->fetchrow();
$rownum = $obj->getRow();
if($rownum < 1){		
	$hit = 1;			
   $sql = "INSERT INTO ".TBL_HITCOUNTER." (page_name,hit) VALUES ('".trim($pageName)."','".trim($hit)."')";			
	$rs = $obj->executeQry($sql,$link);
}
else
{
	$hit = $row['hit'];	
	$conut = $hit + 1;	
	$sql1 = "UPDATE ".TBL_HITCOUNTER." set hit = '".$conut."' where id = ".$row['id'];	
	$rs1 = $obj->executeQry($sql1,$link);
}
?>
