Skip to content

Commit 1607b71

Browse files
[update-query] fix the bindings order when using where
1 parent f2f69a3 commit 1607b71

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Update.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ public function execute()
8484
{
8585
$table = $this->getTable();
8686
$values = implode(",", $this->values);
87-
$where = $this->getwhere();
8887

8988
$query = "UPDATE {$table} SET {$values} WHERE {$this->key} IN(";
9089
foreach ($this->keyValues as $val) {
9190
$query .= "?,";
9291
$this->bindings[] = $val;
9392
}
9493
$query = rtrim($query, ",");
94+
95+
$where = $this->getwhere();
9596
$query .= ") {$where}";
9697

9798
return DB::update($query, $this->bindings);

0 commit comments

Comments
 (0)