#37097 [Asn->WFx]: PDO-MSSQL converts bigint to float.

From: Date: Sun, 30 Apr 2006 01:39:15 +0000
Subject: #37097 [Asn->WFx]: PDO-MSSQL converts bigint to float.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96384@lists.php.net to get a copy of this message
 ID:               37097
 Updated by:       wez@php.net
 Reported By:      stochnagara at hotmail dot com
-Status:           Assigned
+Status:           Wont fix
 Bug Type:         PDO related
 Operating System: windows xp
 PHP Version:      5.1.3RC2
 Assigned To:      wez
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2006-04-16 20:14:49] wez@php.net

FYI: You should use PDO ODBC on Windows.


------------------------------------------------------------------------

[2006-04-16 07:57:49] tony2001@php.net

Assigned to the maintainer.


------------------------------------------------------------------------

[2006-04-16 07:44:32] stochnagara at hotmail dot com

Description:
------------
PDO MsSql driver returns bigint values as float instead of int.
They are always formated as <number>.0

Reproduce code:
---------------
CREATE TABLE demo (
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:
----------------
bi=1;sm=1;

Actual result:
--------------
bi=1.0;sm=1;


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37097&edit=1


Thread (4 messages)

« previous php.bugs (#96384) next »