Skip to content

Commit 390c53a

Browse files
committed
Fixed bool PDO parameters inserting null value when using transactions.
1 parent 6c5b390 commit 390c53a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Pecee/Pixie/QueryBuilder/Transaction.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,16 @@ public function statement(string $sql, array $bindings = []): array
7676
}
7777

7878
try {
79-
$this->transactionStatement->execute($bindings);
79+
80+
foreach ($bindings as $key => $value) {
81+
$this->transactionStatement->bindValue(
82+
\is_int($key) ? $key + 1 : $key,
83+
$value,
84+
$this->parseParameterType($value)
85+
);
86+
}
87+
88+
$this->transactionStatement->execute();
8089
} catch (\PDOException $e) {
8190
throw new Exception($e->getMessage(), 0, $e->getPrevious(), $this->connection->getLastQuery());
8291
}

0 commit comments

Comments
 (0)