forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 4
Database
Derek Jones edited this page Jul 5, 2012
·
9 revisions
TODO: please contribute to complete this wiki.
TODO: please contribute to complete this wiki.
The examples in the user guide enable database debugging. In this mode, database errors are handled by CodeIgniter, so you cannot control the output (errors generate messages). Generally this is not what you want in a production site. To disable debuggin change the following line in config/database.php file:
$db['default']['db_debug'] = TRUE;
to
$db['default']['db_debug'] = FALSE;
After setting this, you can use the return value of database operation methods. Example:
[code] if ($this->USER->insert($id, $name, $password) === FALSE) { $data['result'] = 'failed'; } else { $data['result'] = 'successful'; } [/pre]