|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: stochnagara at hotmail dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 08:01:31 2024 UTC