I am simply trying to increment the amount of page views per visit with CodeIgniter's active record. For some reason, the following code is incrementing twice. So it adds 2 page views per visit. What is strange is that this is used on another website that shares the same table and the same method code and it works properly on the other website. The views field is a simple int(11). I am only calling this method once in the controller, I thought maybe I had a duplicate but I do not.
function increment_video_view($video_pk) {
$this->db->where('video_pk', $video_pk);
$this->db->set('views', 'views+1', FALSE);
$this->db->update('videos');
}
Any ideas or help would be great! Thanks!