Correctly log false as 0 for query logger.

The query logger was replacing `false` and `0` values with an empty string. This corrects that by replacing bools and `0` with a php string representation.
Merge pull request #5429 from dakota/3.0-query-log

Correctly log false as 0 for query logger.