|
|
Click here to view our Go Green Ambassadors at Work.
include "connect.php";
if(!$countername) { $countername = "default"; }
mysql_query("LOCK TABLES counter READ");
if($storyid == '990')
{
$countername = "ehstory";
}
if($storyid == '992')
{
$countername = "ehanth";
}
if($kwd == 'eh')
{
$countername = "ehnews";
}
$query = mysql_query("select * from counter where name='$countername'");
if ($query) {
while ($row = mysql_fetch_array($query)) {
$start = $row[start];
$count = $row[count];
}
$query1 = mysql_query("UNLOCK TABLES");
$query1 = mysql_query("LOCK TABLES counter WRITE");
if(!$count) {
mysql_query("insert into counter values (current_date(),'1','$countername')");
$count = "1";
$_SESSION[$countername] = 1;
}
else {
if (!$_SESSION[$countername]) {
$count++;
mysql_query("update counter set count='$count' where name='$countername'");
$_SESSION[$countername] = 1;
}
}
}
$query1 = mysql_query("UNLOCK TABLES");
print("$count");
?>
|
|
|
|