summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Holywell <[email protected]>2013-01-30 09:22:31 +0000
committerSimon Holywell <[email protected]>2013-01-30 09:22:31 +0000
commit7a43f5dcd50f11217b609fbc89c4239e97482da9 (patch)
treee3158a80762277a125f68ff2c08b40c145dab141
parent38590e8db6f68a9f42c21225f2bf34a0b99e1718 (diff)
Closes issue #99 Undefined index error
-rw-r--r--idiorm.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/idiorm.php b/idiorm.php
index 66a243c..8751085 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -218,7 +218,8 @@
*/
protected static function _setup_db($connection_name = self::DEFAULT_CONNECTION)
{
- if (!is_object(self::$_db[$connection_name])) {
+ if (!array_key_exists($connection_name, self::$_db) ||
+ !is_object(self::$_db[$connection_name])) {
self::_setup_db_config($connection_name);
$db = new PDO(