I am using this function this codeigniter function after update query
$this->db->affected_rows();
it returns number of rows affected if i update values, but if i update values with the same as previous it retuns 0 rows affected
Any help...
I am using this function this codeigniter function after update query
$this->db->affected_rows();
it returns number of rows affected if i update values, but if i update values with the same as previous it retuns 0 rows affected
Any help...
In order to check that the database query succeeded, you can check the error code by using:
If that is empty, you had no error. If not, you have the error message.
_error_number()
is also set, so you can use that instead if you are looking for a particular error.Generally, you can skip the error check if you know there were
affected_rows()
, so you can limit the_error_message()
test to situations whereaffected_rows()
returns 0.All CI database functions return a result if they "successfully run".
So