Create Counter for your web site
Page 1 of 1 • Share •
Create Counter for your web site
- 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

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





