summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/sqlite')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index dad5eeedf..5290edeea 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -536,7 +536,11 @@ class CI_DB_sqlite_driver extends CI_DB {
$orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):'';
- return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$orderby.$limit;
+ $sql = "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr);
+ $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : '';
+ $sql .= $orderby.$limit;
+
+ return $sql;
}