R
R
Ramm2018-02-06 10:30:56
PHP
Ramm, 2018-02-06 10:30:56

Why does pdo driver return int as string?

Problem: Using laravel, eloquent models return int fields as string.
Mysqlnd is installed, maybe you need to configure something at the pdo or eloquent level

PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maksim Fedorov, 2018-02-06
@rammtw

At the PDO level

'options'   => array(
            PDO::ATTR_STRINGIFY_FETCHES => false,
            PDO::ATTR_EMULATE_PREPARES => false,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question