Skip to content

Commit 3a9ff1e

Browse files
authored
Merge pull request #381 from bowphp/refactor/code-base
Fix data binding
2 parents 012c5c8 + fab5efe commit 3a9ff1e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Database/QueryBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function whereRaw(string $where, array $data = []): QueryBuilder
190190
}
191191

192192
if (!empty($data)) {
193-
$this->where_data_binding = array_merge(array_values($data), $this->where_data_binding);
193+
$this->where_data_binding = array_merge($this->where_data_binding, array_values($data));
194194
}
195195

196196
return $this;
@@ -214,7 +214,7 @@ public function orWhereRaw(string $where, array $data = []): QueryBuilder
214214
}
215215

216216
if (!empty($data)) {
217-
$this->where_data_binding = array_merge(array_values($data), $this->where_data_binding);
217+
$this->where_data_binding = array_merge($this->where_data_binding, array_values($data));
218218
}
219219

220220
return $this;
@@ -1477,7 +1477,7 @@ private function execute(string $sql, array $bindings = []): PDOStatement
14771477
$this->triggerQueryEvent($sql, $bindings);
14781478
} catch (\Exception $e) {
14791479
throw new QueryBuilderException(
1480-
'Error executing query: ' . $e->getMessage(),
1480+
'Error executing query: ' . $e->getMessage() . ' | Query: ' . $this->last_query,
14811481
$this->last_query,
14821482
E_ERROR,
14831483
);

0 commit comments

Comments
 (0)