summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/pdo_driver.php
diff options
context:
space:
mode:
authorJonatas Miguel <jonatas.df.miguel@gmail.com>2012-10-24 19:30:36 +0200
committerJonatas Miguel <jonatas.df.miguel@gmail.com>2012-10-24 19:30:36 +0200
commitb51823dde5fbae508b8ebf99258d2f514a8bece8 (patch)
tree4db09a22f85e0ddf151c940cd3e6fbaa799b8513 /system/database/drivers/pdo/pdo_driver.php
parenta53f402b78ad07fb0f6da19cff0c7bec3a09a4c0 (diff)
parenta7001e968a4791312391eb245ad84888893cda8f (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Conflicts: user_guide_src/source/changelog.rst
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 705b16560..32a9e7509 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -45,10 +45,6 @@ class CI_DB_pdo_driver extends CI_DB {
// The character used to escaping
protected $_escape_char = '"';
- // clause and character used for LIKE escape sequences
- protected $_like_escape_str = " ESCAPE '%s' ";
- protected $_like_escape_chr = '!';
-
protected $_random_keyword;
public $trans_enabled = FALSE;
@@ -61,7 +57,7 @@ class CI_DB_pdo_driver extends CI_DB {
*
* Validates the DSN string and/or detects the subdriver
*
- * @param array
+ * @param array $params
* @return void
*/
public function __construct($params)
@@ -187,6 +183,7 @@ class CI_DB_pdo_driver extends CI_DB {
/**
* Begin Transaction
*
+ * @param bool $test_mode = FALSE
* @return bool
*/
public function trans_begin($test_mode = FALSE)
@@ -360,14 +357,12 @@ class CI_DB_pdo_driver extends CI_DB {
*
* @param string the table name
* @param array the update data
- * @param array the where clause
+ * @param string the where key
* @return string
*/
- protected function _update_batch($table, $values, $index, $where = NULL)
+ protected function _update_batch($table, $values, $index)
{
$ids = array();
- $where = ($where !== '' && count($where) >=1) ? implode(' ', $where).' AND ' : '';
-
foreach ($values as $key => $val)
{
$ids[] = $val[$index];
@@ -381,9 +376,7 @@ class CI_DB_pdo_driver extends CI_DB {
}
}
- $sql = 'UPDATE '.$table.' SET ';
$cases = '';
-
foreach ($final as $k => $v)
{
$cases .= $k.' = CASE '."\n";
@@ -396,10 +389,9 @@ class CI_DB_pdo_driver extends CI_DB {
$cases .= 'ELSE '.$k.' END, ';
}
- $sql .= substr($cases, 0, -2);
- $sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')';
+ $this->where($index.' IN('.implode(',', $ids).')', NULL, FALSE);
- return $sql;
+ return 'UPDATE '.$table.' SET '.substr($cases, 0, -2).$this->_compile_wh('qb_where');
}
// --------------------------------------------------------------------