Search
 
SCRIPT & CODE EXAMPLE
 

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
}
Comment

PREVIOUS NEXT
Code Example
Php :: php random number routing 
Php :: laravel get cookie value 
Php :: php kurzschreibweise if 
Php :: php artisan spark not working in codeigniter 
Php :: laravel collection min 
Php :: PHP SimpleXML - Get Node Values 
Php :: simple_html_dom stream does not support seeking 
Php :: doctrine findby regex 
Php :: character encoding to remove question marks as apostrophe php code 
Php :: Registering a variable with $_SESSION. 
Php :: conect_from_db_datalayer 
Php :: email with attcahment in joomla 
Php :: php tree function parrent_id 
Php :: what is the mixmam size that php can take 
Php :: how to clear post array on referesh + not refill when return 
Php :: if condition in laravel blade in select option 
Php :: use middleware in controller to have access session 
Php :: Extract all audio tracks / streams 
Php :: Trying to get property 
Php :: php variables as keys in arrays 
Php :: modal form with php 
Php :: update php version cpanel 
Php :: file_get_contents with url 
Php :: add password php file 
Php :: crrate model in laravel 
Php :: remove column laravel migration 
Java :: java every second 
Java :: spigot cancel repeating task 
Java :: hello world in java 
Java :: how to circular a bitmap android 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =