|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27743 mssql_fetch_object with float
Submitted: 2004-03-29 00:46 UTC Modified: 2004-03-29 13:24 UTC
From: pixyteam at netscape dot net Assigned: fmk (profile)
Status: Closed Package: MSSQL related
PHP Version: 4.3.5 OS: Windows 2000 Server
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: pixyteam at netscape dot net
New email:
PHP Version: OS:


 [2004-03-29 00:46 UTC] pixyteam at netscape dot net
a float value in DB is 3.6000
with PHP 4.3.4 is work O.K.
with PHP 4.3.5 isn't.

Reproduce code:
$sql = "SELECT cost FROM buy WHERE buyid '20040329000001'";
$qid = mssql_query($sql,$lid);
$a   = mssql_fetch_object($qid);
echo sprintf("%.2f",$a->cost);

change $sql is ok.
$sql = "SELECT CONVERT(varchar,cost) AS cost FROM buy WHERE buyid '20040329000001'";
other lines same as ex1.

Expected result:
in 4.3.4 -> 3.60
in 4.3.5 -> 3.60

in 4.3.4 -> 3.60
in 4.3.5 -> 3.60

Actual result:
in 4.3.4 -> 3.60
in 4.3.5 -> 5.04467447157E-041

in 4.3.4 -> 3.60
in 4.3.5 -> 3.60


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-29 13:24 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 21 07:05:44 2022 UTC