php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65454 odbc_result return empty value
Submitted: 2013-08-15 11:15 UTC Modified: 2015-04-12 10:51 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: php at freakout dot de Assigned: cmb (profile)
Status: Closed Package: ODBC related
PHP Version: 5.4.17 OS: Linux
Private report: No CVE-ID: None
 [2013-08-15 11:15 UTC] php at freakout dot de
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-11 15:52 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-04-11 15:52 UTC] cmb@php.net
That sounds really strange. What happens if you use odbc_result()
with echo?
 [2015-04-12 09:31 UTC] php at freakout dot de
-Status: Feedback +Status: Assigned
 [2015-04-12 09:31 UTC] php at freakout dot de
it was a bug in the oracle odbc adapter library - is fixed now.
 [2015-04-12 10:51 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2015-04-12 10:51 UTC] cmb@php.net
Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC