[PHP-BUG] Bug #55751 [NEW]: printf issue in combinatin with com connection
From: Operating system: Windows 7 PHP version: Irrelevant Package: COM related Bug Type: Bug Bug description:printf issue in combinatin with com connection Description: I use PHP Version 5.3.5 but it seems to be not solved in newer Versions It only happends with the number or string 1900 and only if the execute command from the adodb connection was performed. I gues i also happens with other numbers. Test script: --- $ADODB = new COM( 'ADODB.Connection' ); $ADODB-open($strConn); #connection to a MS-Access Database $RS = $ADODB-execute(SELECT Lagerwert FROM tblStammdaten WHERE tblStammdaten.Seriennummer='74925KR9';); echo $RS-Fields(0)-Value . br; $x = sprintf(%f,$RS-Fields(0)-Value); echo $x; Expected result: 1900 1900.00 Actual result: -- 1900 18:0.00 -- Edit bug report at https://bugs.php.net/bug.php?id=55751edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55751r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55751r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55751r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55751r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55751r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55751r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55751r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55751r=needscript Try newer version: https://bugs.php.net/fix.php?id=55751r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55751r=support Expected behavior: https://bugs.php.net/fix.php?id=55751r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55751r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55751r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55751r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55751r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55751r=dst IIS Stability: https://bugs.php.net/fix.php?id=55751r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55751r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55751r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55751r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55751r=mysqlcfg
Bug #55751 [Com]: printf issue in combinatin with com connection
Edit report at https://bugs.php.net/bug.php?id=55751edit=1 ID: 55751 Comment by: michael dot fellinger at multitec-sono dot at Reported by:michael dot fellinger at multitec-sono dot at Summary:printf issue in combinatin with com connection Status: Feedback Type: Bug Package:COM related Operating System: Windows 7 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: 5.3.8 solves the problem, thanks! Previous Comments: [2011-09-21 08:42:11] paj...@php.net Please try with 5.3.8 or a snapshot. [2011-09-21 08:25:03] michael dot fellinger at multitec-sono dot at Description: I use PHP Version 5.3.5 but it seems to be not solved in newer Versions It only happends with the number or string 1900 and only if the execute command from the adodb connection was performed. I gues i also happens with other numbers. Test script: --- $ADODB = new COM( 'ADODB.Connection' ); $ADODB-open($strConn); #connection to a MS-Access Database $RS = $ADODB-execute(SELECT Lagerwert FROM tblStammdaten WHERE tblStammdaten.Seriennummer='74925KR9';); echo $RS-Fields(0)-Value . br; $x = sprintf(%f,$RS-Fields(0)-Value); echo $x; Expected result: 1900 1900.00 Actual result: -- 1900 18:0.00 -- Edit this bug report at https://bugs.php.net/bug.php?id=55751edit=1
Bug #47304 [Com]: typecast of numeric string to float produces strange result
Edit report at https://bugs.php.net/bug.php?id=47304edit=1 ID: 47304 Comment by: michael dot fellinger at multitec-sono dot at Reported by:lennart dot vandendool at fonq dot nl Summary:typecast of numeric string to float produces strange result Status: Assigned Type: Bug Package:Scripting Engine problem Operating System: win32 only PHP Version:5.2.9 Assigned To:pajoye Block user comment: N Private report: N New Comment: Similar Bug in PHP Version 5.3.5 My Code: -- $ADODB = new COM( 'ADODB.Connection' ); $ADODB-open($strConn); $RS = $ADODB-execute(SELECT Lagerwert FROM tblStammdaten WHERE tblStammdaten.Seriennummer='74925KR9';); echo $RS-Fields(0)-Value . br; $x = sprintf(%f,$RS-Fields(0)-Value); echo $x; -- gives following result: --- 1900 18:0.00 --- It only happends with the number or string 1900 and only if the execute command from the adodb connection was performed. I gues i also happens with other numbers. Previous Comments: [2010-11-08 19:04:49] lennart dot vandendool at fonq dot nl The same goes for php-5.3.3-nts-Win32-VC9-x86 on SBS 2003 (x86) and 2008 R2 (x64) [2010-11-08 18:54:24] lennart dot vandendool at fonq dot nl I just tested php-5.3.3-Win32-VC9-x86 on Windows Server 2003 x86 and 2008 R2 x64. The problem doesn't occur anymore. [2010-07-13 12:45:53] ola dot andersson at liko dot se Thank you for your suggestion pajoye. Neither php-5.3.2-nts-Win32-VC6-x86 or php-5.3.2-nts-Win32-VC9-x86 include the extension php_mssql.dll. Without this extension I am not able to properly upgrade and test our systems with this version of PHP. Howcome php_mssql is no longer included with the distributions? [2010-07-12 13:48:17] paj...@php.net Please try with 5.3.2 or 5.3.3RC2 VC9 version. [2010-07-12 12:53:18] ola dot andersson at liko dot se Error occur also when fetching data from a MS SQL server having the column value 290.00 (database Money format). $query =select pris from sa_jobb_3_1 WHERE id='.$id.'; $result = mssql_query($query) or die($query); $row = mssql_fetch_array($result,MSSQL_ASSOC); printf(%f,$row['pris']); The code above outputs incorrectly 28:.00 and not as expected 290.00 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=47304 -- Edit this bug report at https://bugs.php.net/bug.php?id=47304edit=1