• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.