summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2011-12-20 14:08:09 +0100
committerAndrey Andreev <narf@bofh.bg>2011-12-20 14:08:09 +0100
commit072ad622583f79967ed9ab8269911c6700a95a2f (patch)
tree2fc7d768eb364846c1bbd6623696fe4cb85c500a /system/database/drivers/mysql/mysql_driver.php
parent4eea9895e8ced75a1099c56215c09773de94b92c (diff)
parentfec2f59721af5721ede0d2b60075910a6b646c03 (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 828ef006b..6ded6e531 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -606,7 +606,7 @@ class CI_DB_mysql_driver extends CI_DB {
* @param array the limit clause
* @return string
*/
- function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
+ function _update($table, $values, $where, $orderby = array(), $limit = FALSE, $like = array())
{
foreach ($values as $key => $val)
{
@@ -620,6 +620,16 @@ class CI_DB_mysql_driver extends CI_DB {
$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
$sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : '';
+
+ if (count($like) > 0)
+ {
+ $sql .= ($where == '' AND count($where) <1) ? " WHERE " : ' AND ';
+
+ foreach ($like as $st_like)
+ {
+ $sql .= " " . $st_like;
+ }
+ }
$sql .= $orderby.$limit;