php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pixyteam at netscape dot net
New email:
PHP Version: OS:

 

 [2004-03-29 00:46 UTC] pixyteam at netscape dot net
Description:
------------
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:
---------------
ex1:
$sql = "SELECT cost FROM buy WHERE buyid '20040329000001'";
$qid = mssql_query($sql,$lid);
$a   = mssql_fetch_object($qid);
echo sprintf("%.2f",$a->cost);
exit();

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


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

ex2:
in 4.3.4 -> 3.60
in 4.3.5 -> 3.60


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

ex2.
in 4.3.4 -> 3.60
in 4.3.5 -> 3.60



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-29 13:24 UTC] fmk@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC