I'm running update_batch() on a table in CodeIgniter and I'd like to check whether it was successful.
I've tried using affected_rows(), but that only counts the number of form fields that have been modified so it doesn't quite cut it:
$this->db->update_batch("sections", $data, "alias");
log_message("debug", "items in form: ".count($data));
// items in form: 3
log_message("debug", "rows updated: ".$this->db->affected_rows());
// rows updated: 0-3
// depending on whether anything was actually changed on the form
return ($this->db->affected_rows() == count($data)); // unreliable
It seems like a fairly straightforward thing to ask from a batch update function. Is there something I've missed or should I just write my own batch update code?