Answers for "keep track of view count php"

PHP
0

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
}
Posted by: Guest on September-13-2021

Code answers related to "keep track of view count php"

Browse Popular Code Answers by Language