php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23629 Multiple row select floating point fields returning integers after first row
Submitted: 2003-05-14 10:33 UTC Modified: 2003-05-15 03:22 UTC
From: chris at cheeky dot org Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.3.1 OS: Solaris 2.6
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: chris at cheeky dot org
New email:
PHP Version: OS:

 

 [2003-05-14 10:33 UTC] chris at cheeky dot org
When returning multiple rows from a table and some of the fields contain floating point figures (ie Datatypes of Money, Smallmoney or Float).  The first row is returned fine.  Any row after the first, the floating point numbers are sent back as integers.

I have tried sybase_fetch_row, sybase_fetch_array and sybase_fetch_assoc.  All of these produce the same affect.

If I run two lines of SQL to return the two rows seperately, each row will be fine.  It only happens when you select a number of rows at a time.

I have tried this with the above datatypes. Info in our setup is shown below:

Adaptive Server Enterprise/12.0.0.4/P/SWR 10044 ESD 2/Sun_svr4/OS 5.6/1789/32bit/FBO/Mon Feb  4 23:47:53 2002

Apache 1.3.27 with PHP running as a DSO

PHP configureation:

'./configure' '--without-mysql' '--with-apxs=/usr/local/phpapache/bin/apxs' '--enable-track-vars' '--with-jpeg-dir=/export/home/www/packages/jpeg' '--enable-safe-mode' '--with-sybase-ct=/usr/local/sybase/12.0/OCS-12_0' '--with-zlib' '--with-gd' '--with-png-dir=/export/home/www/packages/png' '--with-ttf=/export/home/www/packages/freetype' 

Here is a print_r of the $row which selected two rows where both vat and discount should be the same values in both rows: (I have checked the table in sybase and they are both the same values!)

Array
(
    [transactionid] => 307
    [userid] => 28
    [creationdate] => May 14 2003  4:11PM
    [status] => 0
    [subtotal] => 150
    [discount] => 0
    [vat] => 26.25
    [total] => 176.25
    [deleted] => 0
)
Array
(
    [transactionid] => 308
    [userid] => 28
    [creationdate] => May 14 2003  4:11PM
    [status] => 0
    [subtotal] => 150
    [discount] => 0
    [vat] => 26
    [total] => 176
    [deleted] => 0
)

Cheers.......


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-15 03:21 UTC] chris at cheeky dot org
This functionality seems to be correct using PHP Version 4.3.2-RC3-dev built from source php4-STABLE-200305141530
 [2003-05-15 03:22 UTC] derick@php.net
Good, I thought it was. Closing then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC