CodeIgniter - continue on SQL error?

后端 未结 2 579
一向
一向 2020-12-30 09:53

Basically I have a table with a couple of columns marked Unique. I have a script that dumps a bunch of values into the table with a command like this:

$this-         


        
2条回答
  •  执笔经年
    2020-12-30 10:31

    Yeah, took me a while too and annoyed the hell out of me:

    $db['default']['db_debug'] = FALSE;
    

    ... in config/database.php - disables the error page.

    After a query ran, use this to check for an error:

    if (!empty($this->db->_error_message())) {
        echo "FAIL";
    }
    

提交回复
热议问题