I have problem in codeigniter ,
I want to create article view counter, I create update query in the model to increment number of visitor +1 …
when I run the code, the codeigniter run the query 3 times :mad:
I run the log file in the config, it show me “Final output sent to browser” run 3 times
what’s happens and what should I do to run the code once
$this->db->where(‘id’, $c_id);
$this->db->set(‘no_views’, ‘no_views + 1’, FALSE);
$this->db->update(‘tabel’);
this code for increment number of views,
i try put this code in model and controller and view but the problem not increment 1 Codeigniter increment +3 for each view
when i make debug for Codeigniter, i found the Codeigniter run the site three times…
how i can make Codeigniter run the code only one time
Using .htaccess? Browser requests for missing asset files will be passed back to your application.
Let me restate wiredesignz: Browser requests for missing asset files will be passed back to your application.
>>> Have you looked for such a thing yet. No need to dive into code before doing this.
View with FireFox, browse source and try opening all the CSS, javascript and any other included files such as images. If the file will not open because it is missing then the browser will return with an error to the .htaccess file again causing the code to run again.
Try renaming your .htaccess file and see if the problem persists.