Bug #17681 Updated: Datatype numeric query error
| From: | mfischer@php.net | Date: | Mon, 10 Jun 2002 13:37:48 +0000 |
| Subject: | Bug #17681 Updated: Datatype numeric query error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10019@lists.php.net to get a copy of this message | ||
ID: 17681
Updated by: mfischer@php.net
Reported By: hillbun@hotmail.com
-Status: Open
+Status: Bogus
Bug Type: Sybase (dblib) related
Operating System: Redhat 7.2
PHP Version: 4.2.1
New Comment:
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
See the manual section about floats.
Previous Comments:
------------------------------------------------------------------------
[2002-06-10 09:34:30] hillbun@hotmail.com
We create a table with a field in type of numeric(18,2)
In case of isql, I get the correct result, but in case of PHP, the
result is strange
create table test
(
Id varchar(32) not null,
AA numeric(18,2) not null,
constraint PK_ID primary key (Id)
)
go
INSERT INTO test (Id, AA) VALUES ('0001', 80)
INSERT INTO test (Id, AA) VALUES ('0002', 80.00)
INSERT INTO test (Id, AA) VALUES ('0003', 80.01)
INSERT INTO test (Id, AA) VALUES ('0004', 80.5)
INSERT INTO test (Id, AA) VALUES ('0005', 80.50)
INSERT INTO test (Id, AA) VALUES ('0006', 80.51)
INSERT INTO test (Id, AA) VALUES ('0007', 1111111111111111.55)
INSERT INTO test (Id, AA) VALUES ('0008', 1111111111111111.50)
go
My test script is:
<?php
@$results = sybase_query("select * from test");
while ($row = sybase_fetch_array($results)){
echo "$row[0] ||$row[1] <br>";
}
?>
But I get the following results:
0001 ||80.0
0002 ||80.0
0003 ||80.010000000000005
0004 ||80.5
0005 ||80.5
0006 ||80.510000000000005
0007 ||1111111111111111.5
0008 ||1111111111111111.5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17681&edit=1