I would like to get return info from $CI->db->insert(...)
, both on success and failure.
I have tried to simply catch the return and echo it and print_r it, but neither gives me anything useful; And I have tried $CI->db->display_errors() (though I did not actually find it listed at CI docs).
$return = $this->db->insert( "some_table" , $table_data ) ;
print_r( $return ) ; //
// OR
print ( $this->db->display_errors() ) ;
Does $CI->db->insert(...)
offer a way to check success/failure?
UPDATES:
in CI3 ...
$this->db->_error_message()
generates an error:
Fatal error: Call to undefined method CI_DB_mysqli_driver::_error_message()
(with or without the leading underscore).
$this->db->display_errors()
generates an error: Fatal error: Call to undefined method CI_DB_mysqli_driver::display_errors()
$this->db->insert_id()
generates a 0
(regardless of whether the insert succeeds or fails)