In CodeIgniter My One Query To Update A View Count Is Executing Twice
Is anything there in CodeIgniter to call a controller repeatedly? My problem is I am using a query to set the view count by using this query:
$this->db->set('user_views', 'user_views+1', FALSE);
$this->db->where('slug', $discussion_slug);
$this->db->update('forum_topics')
My site is at http://shinedesk.com/projects/MySeniorLivingGuide/development/forums
. Please check the count of any one of the discussions listed in that page. Then click the discussion link to view that page. The problem is after viewing this discussion and checking the view count in th开发者_开发百科e forums page, the view count gets increased by two.
You have addThis in your page, is it possible that the addThis server is trying to fetch your page, causing the additional request?
Try taking addThis out of the page and see if it still happens.
精彩评论