Skip to content

Commit

Permalink
fix update escape fields
Browse files Browse the repository at this point in the history
  • Loading branch information
francescobianco committed Jun 29, 2020
1 parent d85ebc9 commit af79227
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "javanile/hamper",
"description": "Developer friendly database library for vtiger",
"version": "0.0.3",
"version": "0.0.4",
"license": "MIT",
"type": "library",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion src/HamperDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function update($table, $key, $data, $options = [])
));
}

$fields = implode(' = ?,', array_keys($data)) . ' = ?';
$fields = '`' . implode('` = ?, `', array_keys($data)) . '` = ?';
$params = array_merge(array_values($data), [$data[$key]]);

$sql = "UPDATE `{$table}` SET {$fields} WHERE `{$key}` = ?";
Expand Down

0 comments on commit af79227

Please sign in to comment.