I would like to return INT as integers from my database. At the moment all values are loaded as Strings. Database is MSSQL 2012 and I use the PDO driver (for v5.6).
Trying to set the properties here (as shown here on fideloper.com, but I don't know if that's still possible):
'sqlsrv' => [
'driver' => 'sqlsrv',
'charset' => 'utf8',
'prefix' => '',
......
'options' => array(
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
),
],
But always getting an error:
SQLSTATE[IMSSP]: The given attribute is only supported on the PDOStatement object.
How can I set any settings for the PDO Driver to return INT as Integers and not as Strings.
This is still not working:
$pdo = DB::connection()->getPdo();
$pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
.. do ORM Query
Bringing the same error.
Maybe anyone can help me?