summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2011-09-14 19:47:06 +0200
committerTimothy Warren <tim@timshomepage.net>2011-09-14 19:47:06 +0200
commit51a4888c71287e66d21c9749c13ba895953b9acb (patch)
tree062abfd9ba9a58f0f507450dcd12f8eadff2c9f7 /system/database/drivers
parente113080cff02502a9dc6fe80076f0316708e7acf (diff)
Fixed affected_rows() function, added PDO/postgres note for insert_id() function
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index b0bd7075f..d6af974d6 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -173,12 +173,16 @@ class CI_DB_pdo_driver extends CI_DB {
*
* @access private called by the base class
* @param string an SQL query
- * @return resource
+ * @return object
*/
function _execute($sql)
{
$sql = $this->_prep_query($sql);
- return $this->conn_id->query($sql);
+ $result_id = $this->conn_id->query($sql);
+
+ $this->affect_rows = $result_id->rowCount();
+
+ return $result_id;
}
// --------------------------------------------------------------------
@@ -322,11 +326,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function affected_rows()
{
- if ($this->db_debug)
- {
- return $this->display_error('db_unsuported_feature');
- }
- return FALSE;
+ return $this->affect_rows;
}
// --------------------------------------------------------------------
@@ -337,9 +337,9 @@ class CI_DB_pdo_driver extends CI_DB {
* @access public
* @return integer
*/
- function insert_id()
+ function insert_id($name=NULL)
{
- return $this->conn_id->lastInsertId();
+ return $this->conn_id->lastInsertId($name);
}
// --------------------------------------------------------------------