From:             php at freakout dot de
Operating system: Linux
PHP version:      5.4.17
Package:          ODBC related
Bug Type:         Bug
Bug description:odbc_result return empty value

Description:
------------
Without adding an weird empty printf-statement odbc_result returns empty
values
run with printf-statement
[axel@bongo oracle]$ ./testodbc
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
7876 ADAMS
7900 JAMES
7902 FORD
7934 MILLER

run without the statement:
[axel@bongo oracle]$ ./testodbc
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0


Test script:
---------------
#!/opt/php/bin/php
<?php
//system('/opt/php/bin/php --version | grep -ebuilt -ebuild -eCopyright
-erevision >&2');
$query = "select empno, ename from emp";
$conn = odbc_connect("Oracle", "scott", "tiger");
if($result = odbc_exec($conn, $query)) {
if(!$conn) die("Connection failed");
 while($succ = odbc_fetch_row($result)) {
//   printf("%s",''); // without this statement odbc_result does not work
   printf("%4d %s\n", odbc_result($result, 'EMPNO'), odbc_result($result,
'ENAME'));
 }
}
?>


Expected result:
----------------
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
7876 ADAMS
7900 JAMES
7902 FORD
7934 MILLER


Actual result:
--------------
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0
   0


-- 
Edit bug report at https://bugs.php.net/bug.php?id=65454&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65454&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65454&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65454&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65454&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65454&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65454&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65454&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65454&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65454&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65454&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65454&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65454&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65454&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65454&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65454&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65454&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65454&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65454&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65454&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65454&r=mysqlcfg

Reply via email to