waza-ari / monolog-mysql

MySQL Handler for Monolog, which allows to store log messages to a MySQL Table
MIT License
141 stars 85 forks source link

Fix for SQLSTATE[HY093]: Invalid parameter number #29

Closed nickgravel closed 5 years ago

nickgravel commented 7 years ago

Fixes issue mentioned here https://github.com/waza-ari/monolog-mysql/issues/23

“Situation:

When some additionalFields are provided with empty values. No logs are recorded to database when this warning shows.

Code problem observed:

While $contentArray contains the full list of key-values, $this->statement is only prepared with keys that has non-empty values. Thus it is true that number of bound variables does not match number of tokens.”

clement-garrigou commented 6 years ago

We need this pull request 😄 !

cr-lgl commented 5 years ago

@nickgravel , @clement-garrigou

It's been a long time, but it reflects this. Thanks!