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.