PHP 4.0 Bug #7583 Updated: odbc_result on integer column returns a float value

From: Date: Wed, 08 Nov 2000 20:02:05 +0000
Subject: PHP 4.0 Bug #7583 Updated: odbc_result on integer column returns a float value
Groups: php.dev 
Request: Send a blank email to php-dev+get-37455@lists.php.net to get a copy of this message
ID: 7583 Updated by: waldschrott Reported By: andy@mindgate.net Status: Feedback Bug Type: ODBC related Assigned To: Comments: 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? Previous Comments: --------------------------------------------------------------------------- [2000-11-02 06:47:36] 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-02 02:40:49] andy@mindgate.net odbc_result() returns a decimal instead of an integer value - but the column being returned is of type integer. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7583

« previous php.dev (#37455) next »