php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7583 odbc_result on integer column returns a float value
Submitted: 2000-11-02 02:40 UTC Modified: 2000-12-07 12:02 UTC
From: andy at mindgate dot net Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.3pl1 OS: Windows 2000 SP1
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andy at mindgate dot net
New email:
PHP Version: OS:

 

 [2000-11-02 02:40 UTC] andy at mindgate dot net
odbc_result() returns a decimal instead of an integer value - but the column being returned is of type integer.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-02 06:47 UTC] waldschrott@php.net
Please provide a reduced code fragment (<15 lines) producing
this behaviour.

don?t mix up things float!=decimal, which database are you on?
 [2000-11-08 21:02 UTC] waldschrott@php.net
user update:

I rewrote my bug report (#7583) but I can't seem to
post it back again.  I don't know what cvs user id to
use and just entering my password doesn't work.


Anyway here it is again:

-----start bug report #7583-----

Under MS SQL Server 7 ODBC Driver version (accdg to ODBC Data Sources in the
Control Panel) 3.70.06.23 from Microsoft Corporation, Filename:
SQLSRV32.DLL, after upgrading to PHP 4.0.3pl1 from 4.0.2, the following
statements:

$qryid=odbc_exec($link,"select @@IDENTITY as 'lastinserted'");

$lastinserted=odbc_result($qryid,"lastinserted");

seem to be putting a decimal value instead of an integer in $lastinserted
because an error occurs which displays the value of $lastinserted in the
odbc_exec string (that comes after the 2 statements above) as being in
decimal instead of integer format (i.e. 14.00 instead of just 14).

This also happens when retrieving values from columns
like below:

while (($fetchrowstat=odbc_fetch_row($qryid)) && $counter-->0) {
 $subnum=(odbc_result($qryid,"submission_num");
...

'submission_num' is an MS SQL Server 7 integer column of width 4.

----- end bug report #7583 ----

Note: The value being returned by odbc_result() 
always gets printed out in the form xx.00.  Does 
this mean it is decimal?





 [2000-12-07 12:02 UTC] sniper@php.net
No feedback.

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Jun 14 12:00:01 2026 UTC