Skip to content

Commit 5ced82a

Browse files
committed
Detecting if database connection was not successful
1 parent 115c99e commit 5ced82a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

system/core/Loader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ public function database($params = '', $return = FALSE, $query_builder = NULL)
361361

362362
// Load the DB class
363363
$CI->db =& DB($params, $query_builder);
364+
if (!$CI->db->conn_id)
365+
{
366+
return FALSE;
367+
}
364368
return $this;
365369
}
366370

0 commit comments

Comments
 (0)