Results 1 to 8 of 8

Thread: Videos Watched total not incrementing

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Oct 2007
    Posts
    126

    Default Videos Watched total not incrementing

    Thanks bplex for shooting me back to the view_video.php file.

    More testing shows that incrementation only occurs if a user is logged in and he watches a video that is not his own. Incrementation will not occur if you watch your own video while logged in. And incrementation does not occur if the viewer is not logged in.

    So, my site has no users that log in and therefore had no views adding up. However if I look at individual views for videos I can see numbers increasing.

    Question/Comment: I guess I should remove the if condition surrounding the incrementation code to allow guests to cause the incrementing also.

    if ($_SESSION['UID'] != $video_info['video_user_id'])

    Nope, tried removing that line and it makes no difference. Why not? The UID would be the guest IP address so it should work either way??!!
    I am copying my code in case there is a wrong character I am not seeing here.
    $sql = "UPDATE `users` SET
    `user_video_viewed`=`user_video_viewed`+1 WHERE
    `user_id`='" . (int) $video_info['video_user_id'] . "'";
    mysql_query($sql) or mysql_die($sql);
    Last edited by jayscot; 01-02-2011 at 06:08 AM.
    CasselmanCanada.com (free access)


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •