This code iv written is working as i like, but for some reason when refreshing the page counter adds 2 instead of 1, the Views column is as an Integer.
$updateviews = $db->prepare("UPDATE pages SET views = views + 1 WHERE type = 'home'");
$updateviews->execute();
Hope someone can help, cant seam to find the problem.