Welcome Guest, Not a member yet? Register   Sign In
Handling DB Errors using Query Builder
#1

Hello, i need to know how to handle DB errors when using Query Builder.

I know the following can work as per how is described here
PHP Code:
if ( ! $this->db->simple_query('SELECT `example_field` FROM `example_table`'))
{
 
      $error $this->db->error(); // Has keys 'code' and 'message'


but how can I use it when doing something like this
PHP Code:
$data = array(
 
       'title' => 'My title',
 
       'name' => 'My Name',
 
       'date' => 'My date'
);
$this->db->insert('mytable'$data); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB