Welcome Guest, Not a member yet? Register   Sign In
SQL error messages when using load database
#1

[eluser]Unknown[/eluser]
I'm using active record to insert a row. My model code is:

Code:
function insertNewFlower($data) {
    unset($data['submit']);
    $this->load->database('mysql://flowershop:flowershop@localhost/flowershop');
    $query = $this->db->insert('flowers',$data);
  }

When there was a typo in a column name, the insert quietly fails. No message is issued to the browser and none in the log. The config file uses
Code:
$config['log_threshold'] = 4;
and the database.php file uses
Code:
$db['default']['db_debug'] = TRUE;

I found the error by adding this call
Code:
echo $this->db->last_query();
and copy/paste into the sql interpreter.

Any suggestions for viewing the error message directly?




Theme © iAndrew 2016 - Forum software by © MyBB