Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

keep track of view count php

$sample_rate = 100;
if(mt_rand(1,$sample_rate) == 1) {
    $query = mysql_query(" UPDATE posts SET views = views + {$sample_rate} WHERE id = '{$id}' ");
    // execute query, etc
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #track #view #count #php
ADD COMMENT
Topic
Name
3+3 =