Fix issue #1994
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 488ebf3..a32fd44 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -106,9 +106,9 @@
 			return $this->db->data_cache['db_names'];
 		}
 
-		for ($i = 0, $c = count($query); $i < $c; $i++)
+		for ($i = 0, $query = $query->result_array(), $c = count($query); $i < $c; $i++)
 		{
-			$this->db->data_cache['db_names'] = current($query[$i]);
+			$this->db->data_cache['db_names'][] = current($query[$i]);
 		}
 
 		return $this->db->data_cache['db_names'];