summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-03-01 18:34:09 +0100
committerTimothy Warren <tim@timshomepage.net>2012-03-01 18:34:09 +0100
commiteabc5ec81209ec83393222f2964098aedf6dbc7a (patch)
tree1834fa8ca7b788d27cf0e916f9578d8bb8f1f999 /system/database/drivers/pdo
parenta0da0b28bdb0ff73d5c0d9f8780ab0f6d74f39e3 (diff)
parente3a68042c086acfc98ae273adbd8527af0c6ab8b (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into firebird
Diffstat (limited to 'system/database/drivers/pdo')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php47
1 files changed, 9 insertions, 38 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 44e93a042..90f0fd791 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -289,21 +289,6 @@ class CI_DB_pdo_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Set client character set
- *
- * @access public
- * @param string
- * @param string
- * @return resource
- */
- function db_set_charset($charset, $collation)
- {
- return TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
* Version number query string
*
* @return string
@@ -509,33 +494,19 @@ class CI_DB_pdo_driver extends CI_DB {
/**
* Insert ID
- *
- * @access public
- * @return integer
+ *
+ * @return int
*/
- function insert_id($name=NULL)
+ public function insert_id($name = NULL)
{
- if ($this->pdodriver == 'pgsql')
+ if ($this->pdodriver === 'pgsql' && $name === NULL && $this->_version() >= '8.1')
{
- //Convenience method for postgres insertid
- $v = $this->_version();
-
- $table = func_num_args() > 0 ? func_get_arg(0) : NULL;
-
- if ($table == NULL && $v >= '8.1')
- {
- $sql='SELECT LASTVAL() as ins_id';
- }
-
- $query = $this->query($sql);
- $row = $query->row();
-
- return $row->ins_id;
- }
- else
- {
- return $this->conn_id->lastInsertId($name);
+ $query = $this->query('SELECT LASTVAL() AS ins_id');
+ $query = $query->row();
+ return $query->ins_id;
}
+
+ return $this->conn_id->lastInsertId($name);
}
// --------------------------------------------------------------------