php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23171 sybase_fetch_* functions round off floats
Submitted: 2003-04-11 10:58 UTC Modified: 2003-04-12 09:23 UTC
From: thni at kundkraft dot se Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
 [2003-04-11 10:58 UTC] thni at kundkraft dot se
The sybase_fetch_array and sybase_fetch_object functions seem to cast float values to integers from the second resultset and onwards.
The following script doesn't echo two floats, but a float and an integer(1.23 and 4). 

<?php
/*
Test table layout and data:
create table test (id  float)
go
insert into test values(1.23)
insert into test values(4.56)
go
*/
$conn = sybase_pconnect("foo", "bar", "baz");
$q = sybase_query("SELECT id FROM test");
while($res = sybase_fetch_array($q)) {
    echo "$res[0]<br>";
}
?>

My configure line is:
./configure --with-sybase-ct=/opt/sybase --enable-ftp --with-apache=../apache_1.3.27 --with-gd --enable-trans-sid --disable-debug --enable-bcmath --with-zlib --without-mysql

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-12 09:23 UTC] thekid@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC