Got PDO working
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 000ac08..3adc5f5 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -51,6 +51,9 @@
 	function CI_DB_pdo_driver($params)
 	{
 		parent::CI_DB($params);
+		
+		$this->hostname = $this->hostname . ";dbname=".$this->database;
+		$this->trans_enabled = FALSE;
 
 		$this->_random_keyword = ' RND('.time().')'; // database specific random keyword
 	}
@@ -63,7 +66,8 @@
 	 */
 	function db_connect()
 	{
-		return new PDO($this->hostname, $this->username, $this->password, array(
+		return new PDO($this->hostname,$this->username,$this->password, array(
+			PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT
 		));
 	}
 
@@ -77,7 +81,9 @@
 	 */
 	function db_pconnect()
 	{
-		return new PDO($this->hostname, $this->username, $this->password, array(
+		return new PDO($this->hostname,$this->username,$this->password, array(
+			PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT,
+			PDO::ATTR_PERSISTENT => true
 		));
 	}
 
@@ -152,7 +158,7 @@
 	function _execute($sql)
 	{
 		$sql = $this->_prep_query($sql);
-		return @pdo_exec($this->conn_id, $sql);
+		return $this->conn_id->query($sql);
 	}
 
 	// --------------------------------------------------------------------
@@ -197,7 +203,7 @@
 		// even if the queries produce a successful result.
 		$this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE;
 
-		return pdo_autocommit($this->conn_id, FALSE);
+		return $this->conn_id->beginTransaction();
 	}
 
 	// --------------------------------------------------------------------
@@ -221,8 +227,7 @@
 			return TRUE;
 		}
 
-		$ret = pdo_commit($this->conn_id);
-		pdo_autocommit($this->conn_id, TRUE);
+		$ret = $this->conn->commit();
 		return $ret;
 	}
 
@@ -247,8 +252,7 @@
 			return TRUE;
 		}
 
-		$ret = pdo_rollback($this->conn_id);
-		pdo_autocommit($this->conn_id, TRUE);
+		$ret = $this->conn_id->rollBack();
 		return $ret;
 	}
 
@@ -311,7 +315,7 @@
 	 */
 	function insert_id()
 	{
-		return @pdo_insert_id($this->conn_id);
+		return $this->conn_id->lastInsertId();
 	}
 
 	// --------------------------------------------------------------------
@@ -411,7 +415,8 @@
 	 */
 	function _error_message()
 	{
-		return pdo_errormsg($this->conn_id);
+		$error_array = $this->conn_id->errorInfo();
+		return $error_array[2];
 	}
 
 	// --------------------------------------------------------------------
@@ -424,7 +429,7 @@
 	 */
 	function _error_number()
 	{
-		return pdo_error($this->conn_id);
+		return $this->conn_id->errorCode();
 	}
 
 	// --------------------------------------------------------------------
@@ -488,7 +493,7 @@
 			$tables = array($tables);
 		}
 
-		return '('.implode(', ', $tables).')';
+		return (count($tables) == 1) ? $tables[0] : '('.implode(', ', $tables).')';
 	}
 
 	// --------------------------------------------------------------------
diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php
index 161a77b..c386586 100644
--- a/system/database/drivers/pdo/pdo_result.php
+++ b/system/database/drivers/pdo/pdo_result.php
@@ -34,7 +34,7 @@
 	 */
 	function num_rows()
 	{
-		return @pdo_num_rows($this->result_id);
+		return $this->result_id->rowCount();
 	}
 
 	// --------------------------------------------------------------------
@@ -47,7 +47,7 @@
 	 */
 	function num_fields()
 	{
-		return @pdo_num_fields($this->result_id);
+		return $this->result_id->columnCount();
 	}
 
 	// --------------------------------------------------------------------
@@ -62,13 +62,11 @@
 	 */
 	function list_fields()
 	{
-		$field_names = array();
-		for ($i = 0; $i < $this->num_fields(); $i++)
+		if ($this->db->db_debug)
 		{
-			$field_names[]	= pdo_field_name($this->result_id, $i);
+			return $this->db->display_error('db_unsuported_feature');
 		}
-
-		return $field_names;
+		return FALSE;
 	}
 
 	// --------------------------------------------------------------------
@@ -83,20 +81,25 @@
 	 */
 	function field_data()
 	{
-		$retval = array();
-		for ($i = 0; $i < $this->num_fields(); $i++)
+		$data = array();
+	
+		try
 		{
-			$F				= new stdClass();
-			$F->name		= pdo_field_name($this->result_id, $i);
-			$F->type		= pdo_field_type($this->result_id, $i);
-			$F->max_length	= pdo_field_len($this->result_id, $i);
-			$F->primary_key = 0;
-			$F->default		= '';
-
-			$retval[] = $F;
+			for($i = 0; $i < $this->num_fields(); $i++)
+			{
+				$data[] = $this->result_id->getColumnMeta($i);
+			}
+			
+			return $data;
 		}
-
-		return $retval;
+		catch (Exception $e)
+		{
+			if ($this->db->db_debug)
+			{
+				return $this->db->display_error('db_unsuported_feature');
+			}
+			return FALSE;
+		}
 	}
 
 	// --------------------------------------------------------------------
@@ -144,14 +147,7 @@
 	 */
 	function _fetch_assoc()
 	{
-		if (function_exists('pdo_fetch_object'))
-		{
-			return pdo_fetch_array($this->result_id);
-		}
-		else
-		{
-			return $this->_pdo_fetch_array($this->result_id);
-		}
+		return $this->result_id->fetch(PDO::FETCH_ASSOC);
 	}
 
 	// --------------------------------------------------------------------
@@ -165,60 +161,8 @@
 	 * @return	object
 	 */
 	function _fetch_object()
-	{
-		if (function_exists('pdo_fetch_object'))
-		{
-			return pdo_fetch_object($this->result_id);
-		}
-		else
-		{
-			return $this->_pdo_fetch_object($this->result_id);
-		}
-	}
-
-
-	/**
-	 * Result - object
-	 *
-	 * subsititutes the pdo_fetch_object function when
-	 * not available (pdo_fetch_object requires unixPDO)
-	 *
-	 * @access	private
-	 * @return	object
-	 */
-	function _pdo_fetch_object(& $pdo_result) {
-		$rs = array();
-		$rs_obj = FALSE;
-		if (pdo_fetch_into($pdo_result, $rs)) {
-			foreach ($rs as $k=>$v) {
-				$field_name= pdo_field_name($pdo_result, $k+1);
-				$rs_obj->$field_name = $v;
-			}
-		}
-		return $rs_obj;
-	}
-
-
-	/**
-	 * Result - array
-	 *
-	 * subsititutes the pdo_fetch_array function when
-	 * not available (pdo_fetch_array requires unixPDO)
-	 *
-	 * @access	private
-	 * @return	array
-	 */
-	function _pdo_fetch_array(& $pdo_result) {
-		$rs = array();
-		$rs_assoc = FALSE;
-		if (pdo_fetch_into($pdo_result, $rs)) {
-			$rs_assoc=array();
-			foreach ($rs as $k=>$v) {
-				$field_name= pdo_field_name($pdo_result, $k+1);
-				$rs_assoc[$field_name] = $v;
-			}
-		}
-		return $rs_assoc;
+	{	
+		return $this->result_id->fetchObject();
 	}
 
 }