|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-12-01 05:35 UTC] ssufficool@php.net
-Status: Open
+Status: Bogus
[2011-12-01 05:35 UTC] ssufficool@php.net
[2012-02-07 08:50 UTC] martijntje at martijnotto dot nl
[2012-09-10 23:30 UTC] brandonkirsch at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 13:00:02 2025 UTC |
Description: ------------ odbc_* and PDO ODBC functions are each returning SQL integer values as PHP strings. However, SQL NULL values properly appear as PHP NULL values. I have tested against multiple ODBC providers (FreeTDS and iSeries Access for Linux). System: SUSE Enterprise Linux Server 10 (SP2) - 32bit Linux dev-webhost1 2.6.16.60-0.42.5-default #1 Mon Aug 24 09:41:41 UTC 2009 i686 i686 i386 GNU/Linux UnixODBC PHP 5.3.6 from source ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with- mssql=/usr/local/freetds --with-ldap --prefix=/usr/local/php5 --with-config- file- path=/usr/local/php5/etc --enable-sockets --enable-soap --with-openssl --with- unixODBC=/usr --with-gd --with-jpeg-dir=/usr/lib --with-pdo-odbc=unixODBC,/usr Test script: --------------- 1. odbc_* against FreeTDS to SQL Server 2008: $odbc = odbc_connect('hpsql3','--censored--','--censored--'); $or = odbc_exec($odbc,'SELECT 1'); var_dump(odbc_fetch_array($or)); // array( string "1" ) 2. odbc_* against iSeries Access for Linux to AS/400: $odbc = odbc_connect('iSeriesDSN','--','--'); $or = odbc_exec($odbc,'SELECT 1 FROM SYSIBM.SYSDUMMY1'); var_dump(odbc_fetch_array($or)); // array( string "1" ) 3. PDO against FreeTDS to SQL Server 2008 $pdo = new PDO('odbc:hpsql3','--','--'); var_dump($pdo->query('SELECT 1')->fetch(PDO::FETCH_ASSOC)); // array (string "1") 4. PDO against iSeries Access for Linux to AS/400 $pdo = new PDO('odbc:iSeriesDSN','--','--'); var_dump($pdo->query('SELECT 1 FROM SYSIBM.SYSDUMMY1')->fetch(PDO::FETCH_ASSOC)); // array (string "1") Expected result: ---------------- I expect to get arrays containing (int) 1 Actual result: -------------- I actually get arrays containing (string) "1"