Welcome Guest, Not a member yet? Register   Sign In
Unxpected behaviour with $this->db->update_batch() and $this->db->insert_batch()
#1

[eluser]JustinWyllie[/eluser]
Hi

In my database config file I have set db_debug to false.

If a call to $this->db->update() fails CI doesn't output an error page - I just check for the return value of ->update() being false and handle it myself. This is exactly what I want.

However with $this->db->update_batch() I am finding that the return value from the function is null. It is even null if it succeeds. This is not what I want as I can't check for an error.

I would add; on testing, the behaviour for $this->db->insert_batch() is different. This function returns true in either case; whether it succeeds or not.

Clearly this behaviour is not consistent and for that reason alone is a bug no?

In summary:

$this->db->update_batch() has no return value whether it succeeds or fails.
$this->db->insert_batch() returns true whether it succeeds or fails.

This is against mysql 5.0.37 and using the mysqli dbdriver.

Also for information, the practical solution to my problem seems to be to check for
$this->db->_error_message();


Thanks

--JustinWyllie


Messages In This Thread
Unxpected behaviour with $this->db->update_batch() and $this->db->insert_batch() - by El Forum - 07-24-2012, 10:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB