Create Counter for your web site

Post new topic   Reply to topic

View previous topic View next topic Go down

Create Counter for your web site

Post  Admin on Wed Dec 12, 2007 6:10 am

Code:

$SQL="Select * from `counter` where `the_date` = now()"
   $cmd = mysql_query($SQL, $cnn) or die(mysql_error());
   $rst = mysql_fetch_assoc($cmd);
   $rec = mysql_num_rows($cmd);
      if ($rec > 0 ) {
mysql_query("update `counter` set `vis_count` = (`vis_count`+1) where `the_date` = now()",$cnn);
      }else{
         mysql_query("insert   into `counter` (`the_date`,`vis_count`) VALUES (now(),1)",$cnn);
      }

Admin
Admin

Number of posts: 6
Registration date: 2007-12-10

View user profile http://mostshar.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


Permissions of this forum:
You cannot reply to topics in this forum