Skip to content

Commit c99d261

Browse files
committed
Fix for #204: Update with join statement get error
1 parent 0b90f4c commit c99d261

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MysqliDb.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function update($tableName, $tableData)
358358
if ($this->isSubQuery)
359359
return;
360360

361-
$this->_query = "UPDATE " . self::$_prefix . $tableName ." SET ";
361+
$this->_query = "UPDATE " . self::$_prefix . $tableName;
362362

363363
$stmt = $this->_buildQuery (null, $tableData);
364364
$status = $stmt->execute();
@@ -723,7 +723,8 @@ protected function _buildTableData ($tableData) {
723723
if ($isInsert !== false) {
724724
$this->_query .= '(`' . implode(array_keys($tableData), '`, `') . '`)';
725725
$this->_query .= ' VALUES(';
726-
}
726+
} else
727+
$this->_query .= " SET ";
727728

728729
foreach ($tableData as $column => $value) {
729730
if ($isUpdate !== false)

0 commit comments

Comments
 (0)