Skip to content

Commit

Permalink
Merge pull request #29 from nickgravel/master
Browse files Browse the repository at this point in the history
Fix for SQLSTATE[HY093]: Invalid parameter number
  • Loading branch information
cr-lgl authored Oct 7, 2019
2 parents 0b5339d + 48c08c9 commit 45a4bf3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MySQLHandler/MySQLHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ protected function write(array $record)

$this->prepareStatement();

//Remove unused keys
foreach($this->additionalFields as $key => $context) {
if(! isset($contentArray[$key])) {
unset($this->additionalFields[$key]);
}
}

//Fill content array with "null" values if not provided
$contentArray = $contentArray + array_combine(
$this->additionalFields,
Expand Down

0 comments on commit 45a4bf3

Please sign in to comment.