Simple query insert duplicates

Hey everybody,

Do you have any idea why runs this query twice?

function log($name, $message, $type = 'user')
        $entry = array(
            'name' => $name,
            'message' => $message,
            'type' => $type,
            'ip' => $this->input->ip_address(),
            'logdate' => date('Y-m-d H:i:s')

        $this->db->insert('watchdog', $entry);

test it
function test()
        $this->watchdog_model->log('system', $this->lang->line('w_unlock_users'), 'maintance');

It insert two rows in the database, and I really don't know why?

Thx for your help!

That is all your code? maybe you are calling log method in another place or something like that?


Or have a redirect reloading the page, or a missing image that causes a rewrite request to index.php...

Set your log_threshold to 4, and check your application log. You should see multiple requests there if that is causing it.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.