I have some database connections, and i load database in controller if necessary.
And i want continue my script work, if database is shutdown.
But if some database is shutdown, my script stopped with error: "unable connect to database".
And i'm solve this problem (db_gebug = FALSE), and now my script also stopped and i see error "undefined variable DB2" from model file, this tell me about CodeIgniter db connection not returning FALSE in my var.
My script logic in controller:
> .......
> $DB2 = $this->load->database('db2', TRUE, TRUE);
> if ($DB2) {
> $this->load->model('some_model');
> //actions
> }
> else $data['content'] = 'server now is shutdown';
> .......
Result: var DB2 not gain FALSE, if mysql server is shutdown, and my script logic not work, and i have errors. And if i change "if ($DB2)" to "if (isset($DB2))", it also not work.
How i can fix it?