Update the views property ... where the ID is equal to the current record ID.
Now ofcouse i can do some hardcording like the following:
Code: Select all
$db = new PDO('mysql:host=localhost;dbname=peckinga_tinyblog', 'peckinga_general', 'gautam');
// Update views
$query = "UPDATE tinyblog SET views = views + 1 WHERE id = :views_id";
$stmt = $db->prepare($query);
$stmt->execute(array(":views_id"=>$article_id));