|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-11-19 10:17 UTC] stefan dot mueller at meteotest dot ch
[2020-10-05 08:55 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2020-10-05 08:55 UTC] cmb@php.net
[2020-10-18 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ Test environment: - Windows 7 32bit, PHP 5.2.9 and PHP 5.3.1., MS Access 2002 SP3 - ODBC 'DSN1': Microsoft Access Driver (*.mdb) 6.01.7600.16385 - ODBC 'DSN2': Microsoft Access Driver (*.mdb,*.adccdb) 14.00.4760.1000 - Test to access the database also performed with IDL (www.ittvis.com) In the access database I have a value -0.0864691123456789 (this is 19 characters long which is important) in a column defined as DOUBLE. When I connect to the database with 'DSN1' then I get an ASCII 0 back with PHP 5.2.9 and 5.3.1. When I connect to the database with 'DSN2' then I get an 'E-2' (the exponent of the floating point number) back with PHP 5.2.9 and 5.3.1. When I retrieve the data with IDL from 'DSN1' and 'DSN2' I get the correct numbers. When I cut the last character in the access database -0.086469112345678 so that the cell contains only 18 characters, the correct numbers are retrieved with PHP. Row from Access DB 163 12 1 1 x 132.449361609318 14.714402153458 75 3.08241316815042 -4.2982786671882 -8.64691123456789E-02 0 Test script: --------------- $conn = odbc_connect("'DSN1' or 'DSN2', '', '') or die ("Could not connect to database."); $sql = "SELECT * FROM table;"; $res = odbc_exec($conn, $sql); while ($x = odbc_fetch_array($res)){ var_dump($x); if(!is_numeric($x['column'])) { var_dump(ord($x['column'])); } } odbc_free_result($res); odbc_close($conn); Expected result: ---------------- array 'ID' => string '163' (length=3) 'CC' => string '12' (length=2) 'Z3' => string '1' (length=1) 'LFIREG' => string '1' (length=1) 'orgBoden' => string 'x' (length=1) 'cl' => string '132.449361609318' (length=16) 'cd' => string '14.714402153458' (length=15) 'cs' => string '75.0' (length=4) 'incr_cl' => string '3.08241316815042' (length=16) 'decr_cl' => string '-4.2982786671882' (length=16) 'd_cd' => string '-0.0864691123456789' (length=19) 'd_cs' => string '0.0' (length=3) Actual result: -------------- array 'ID' => string '163' (length=3) 'CC' => string '12' (length=2) 'Z3' => string '1' (length=1) 'LFIREG' => string '1' (length=1) 'orgBoden' => string 'x' (length=1) 'cl' => string '132.449361609318' (length=16) 'cd' => string '14.714402153458' (length=15) 'cs' => string '75.0' (length=4) 'incr_cl' => string '3.08241316815042' (length=16) 'decr_cl' => string '-4.2982786671882' (length=16) 'd_cd' => string '�' (length=1) 'd_cs' => string '0.0' (length=3) int 0