Using PHP 5.5 x64 on Ubuntu.
I am trying to fetch some data from an MSSQL database using mssql_query; there is a variety of data types in the columns fetched, and it appears that no matter what I try, bigints (usually of numeric length 19) always convert to a float with accuracy loss.
Instead of getting 1000000000000000010, I am sometimes getting 1000000000000000012 or 1000000000000000009 and so on.
So far, I have tried:
Changing precision with ini_set to 19 (it works as expected up to 16, 17 and above seems to have no effect)
Playing around with fetch_assoc and fetch_object
Using PDO (not sqlsrv)
Upgrading to PHP 7.2 and using PDO (not sqlsrv)
Changing PHP settings and installing packages is possible - changing the data type of the SQL Server unfortunately isn't. For performance reasons, I am avoiding the use of CONVERT, as I'm dealing with big data.
How can I avoid the accuracy loss of the last digit?