【php开源代码栏目提醒】:网学会员,鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“shop_stat_prod.php”一文,供大家参考学习!
<?
Function shop_stat_prod($article_id){
$q=mysql_query("select * from stat_prod where article_id='$article_id' and day=now()");
if(!mysql_num_rows($q)){
mysql_query("insert into stat_prod (article_id,views,day) values ('$article_id','1',now())");
}else{
$a=my
sql_fetch_array($q);
$id=$a["id"];
$views=$a["views"]+1;
mysql_query("update stat_prod set views='$views' where id='$id'");
}
}
?>