Alternative title: Why is PDO converting all my numbers to strings?

When querying a database with PDO in PHP, you will get numeric values returned as strings.  This is fine in PHP and you don't need to worry.

If you convert to JSON though and pass to Javascript, you may have issues, as Javascript is a typed language.

Since PHP5.3.3, you can pass JSON_NUMERIC_CHECK to json_encode to have it detect numeric values and cast them as appropriate.

...Click for More
Article
IT
javascript
json
Numeric values
PDO
Programming