summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_driver.php30
-rw-r--r--system/database/DB_query_builder.php2
2 files changed, 4 insertions, 28 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index e8286aaa1..795ed6711 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1080,43 +1080,19 @@ abstract class CI_DB_driver {
*/
public function update_string($table, $data, $where)
{
- if ($where === '')
+ if (empty($where))
{
return FALSE;
}
+ $this->where($where);
+
$fields = array();
foreach ($data as $key => $val)
{
$fields[$this->protect_identifiers($key)] = $this->escape($val);
}
- if ( ! is_array($where))
- {
- $dest = array($where);
- }
- else
- {
- $dest = array();
- foreach ($where as $key => $val)
- {
- $prefix = (count($dest) === 0) ? '' : ' AND ';
- $key = $this->protect_identifiers($key);
-
- if ($val !== '')
- {
- if ( ! $this->_has_operator($key))
- {
- $key .= ' =';
- }
-
- $val = ' '.$this->escape($val);
- }
-
- $dest[] = $prefix.$key.$val;
- }
- }
-
return $this->_update($this->protect_identifiers($table, TRUE, NULL, FALSE), $fields, $dest);
}
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index a3585586e..cc43d834c 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1575,7 +1575,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
}
$sql = $this->_update($this->protect_identifiers($this->qb_from[0], TRUE, NULL, FALSE), $this->qb_set);
-
+var_dump($sql);
$this->_reset_write();
return $this->query($sql);
}