<?
/*
TDs Counter 1.0
Copyright 2000-2001 KMR Enterprises
Scripted by TDavid @ http://www.tdscripts.com/ 
http://www.php-scripts.com (Example #31,32)
Purpose: a mult-page counter system in PHP / mySQL

This code is made available freely to modify as long as
this COMPLETE header is not removed. If you decide to use this 
code then please put up a reciprocal link back to our site at
http://www.tdscripts.com/

We cannot, and will not, be held liable for any use or misuse
of the code contained herein. Any upload or execution of the
code implies understanding and agreement of these terms of use.
*/

$db "DATABASE NAME";
$admin "MYSQL USER NAME";
$adpass "MYSQL PASSWORD";
$mysql_link mysql_connect("localhost"$admin$adpass);
mysql_select_db($db$mysql_link);

$result mysql_query("SELECT impressions from tds_counter where COUNT_ID='$cid'"$mysql_link);
if(
mysql_num_rows($result)) {
   mysql_query("UPDATE tds_counter set impressions=impressions+1 where COUNT_ID='$cid'"$mysql_link);
   $row mysql_fetch_row($result);
   if($inv != 1) {
       print("$row[0]");
   }
}
?>