用法
--------counter.php-----------
1) { $counter_error_states=-40; $counter_error_msg="发生没有预期的错误=数据行数错误"; return -40; } $count=0; $str="INSERT "; $strWhere=""; if($num==1) { $row=@mysql_fetch_array($db_res); @mysql_free_result($db_res); $count=$row["count"]; $id=$row["id"]; $str="UPDATE "; $strWhere=" WHERE id=$id"; } if($add<1)return $count; $count+=$add; $str.=$db_table." SET file=\"".$file."\",query=\"".$query."\",time=\"".date("Y;n;d;G;i;s")."\",count=".$count.$strWhere; $db_res=@mysql_query($str); if(!$db_res) { $counter_error_states=-50; $counter_error_msg="不能添加或更新记录"; return -50; } return $count; } } } ?>