Welcome Guest, Not a member yet? Register   Sign In
insert_batch returning -1 when query fails
#1

I'm trying to work with the query builder's insert_batch function. According to the documentation, it should return FALSE on failure. That is not the case.

Try this controller method:
PHP Code:
    public function barf() {
        
$data = array(
                array(
                        
'title' => 'My title',
                        
'name' => 'My Name',
                        
'date' => 'My date'
                
),
                array(
                        
'title' => 'Another title',
                        
'name' => 'Another Name',
                        
'date' => 'Another date'
                
)
        );
        
$retval $this->db->insert_batch("i_do_not_exist"$data);
        
var_dump($retval);
    } 

Seems to me it should probably throw an exception and at the very least it should return false.
Reply


Messages In This Thread
insert_batch returning -1 when query fails - by sneakyimp - 11-30-2016, 03:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB