Welcome Guest, Not a member yet? Register   Sign In
Query executed twice
#1

[eluser]Unknown[/eluser]
Hey there,

several hours i try to figured out why my code execute a mysql query twice. If i debug my site via
Code:
$this->output->enable_profiler(TRUE);
the query seems to be executed once but if by using a hook to log all queries (-> post) the INSERT-query appears twice. Has anyone some experience with a several bug?

I'm using the version 2.1.4

controller:
Code:
public function __construct() {
            parent::__construct();
            $this->load->model('Frontend_model');
            $this->output->enable_profiler(TRUE);
      }
      .
      .
      .
      public function site($id){
            $this->journal->visited($id);
      }

journal library:
Code:
protected $ci;
    
    public function __construct(){
            $this->ci  =& get_instance();
    }
    .
    .
    .
    public function visited($siteID, $details = NULL){
          $this->ci->db->insert('journal', array('site_id' => $siteID, 'action_id' => 1, 'details' => $details));
          echo 'test';
    }

The strange thing: even "test" only appears once!

Greets!
Daniel
#2

[eluser]Unknown[/eluser]
To identify the problem i added these lines to the custructor of the controller which handels the request:
Code:
$filepath = APPPATH . 'logs/test';
$handle = fopen($filepath, "a+");
fwrite($handle, 'request!'."\n\n");
fclose($handle);
"request!" appears twice...

UPDATE:
So now i totaly confused:
If i access the website using Google Chrome "request!" appears twice but by only once by using Firefox.

This bug drives me crazy -.-

UPDATE:
To make sure, that the bug isnt hide in my code i added the loggig code into the constructor of the welcom.php of a fresh installation. Same Bug: Google Chrome 2x "request!", Firefox 1x "request!"

unbelievable...

UPDATE:
The bug has been caused by any chrome extension... awkward!




Theme © iAndrew 2016 - Forum software by © MyBB