Welcome Guest, Not a member yet? Register   Sign In
Simple query insert duplicates
#1

[eluser]JohnnyBravo[/eluser]
Hey everybody,

Do you have any idea why runs this query twice?

maintance_model.php
Code:
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
Code:
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!
#2

[eluser]Martín[/eluser]
That is all your code? maybe you are calling log method in another place or something like that?

Regards!
#3

[eluser]WanWizard[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB