|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37097 PDO-MSSQL converts bigint to float.
Submitted: 2006-04-16 07:44 UTC Modified: 2006-04-30 01:39 UTC
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: stochnagara at hotmail dot com Assigned: wez (profile)
Status: Wont fix Package: PDO related
PHP Version: 5.1.3RC2 OS: windows xp
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-04-16 07:44 UTC] stochnagara at hotmail dot com
PDO MsSql driver returns bigint values as float instead of int.
They are always formated as <number>.0

Reproduce code:
bi bigint not null,
sm int null
insert into demo (1,1);

$result = $pdo->query ("SELECT * FROM demo")->fetch();
echo "bi={$result['bi']};"
echo "sm={$result['sm']};"

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-16 07:57 UTC]
Assigned to the maintainer.

 [2006-04-16 20:14 UTC]
FYI: You should use PDO ODBC on Windows.

 [2006-04-30 01:39 UTC]
That's the stringified format that dblib returns to PDO.
We're not going to "fix" this; we asked for a string and that's the string that is handed to us by dblib.

You should also note that dblib on windows is an unsupported legacy library that has not shipped with SQL server for the last couple of releases; unless you absolutely MUST use it, you are STRONGLY recommended to use ODBC to connect to MSSQL.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 23:03:37 2021 UTC