CodeIgniter increases / views pageviews twice, not once

I'm just trying to increase pageviews per visit with an active CodeIgniter entry. For some reason, the following code is doubled. Thus, he adds 2 page views per visit. It is strange that this is used on another website that uses the same table and the same method code, and works on another website. The views field is a simple int (11). I only call 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! Thank!

+3
source share
3 answers

echo ( log) , , . , .

function increment_video_view($video_pk) {
    echo "We in increment_video_view";
    $this->db->where('video_pk', $video_pk);
    $this->db->set('views', 'views+1', FALSE);
    $this->db->update('videos');
}
+1

, ?

0

, 404 (/css/favicon) HTML , favicon.ico

Chrome favicon.ico, HTML, , , .

0

All Articles