Bug #65454 [Opn->Fbk]: odbc_result return empty value
Edit report at https://bugs.php.net/bug.php?id=65454&edit=1
ID: 65454
Updated by: cmb@php.net
Reported by: php at freakout dot de
Summary: odbc_result return empty value
-Status: Open
+Status: Feedback
Type: Bug
Package: ODBC related
Operating System: Linux
PHP Version: 5.4.17
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
That sounds really strange. What happens if you use odbc_result()
with echo?
Previous Comments:
------------------------------------------------------------------------
[2013-08-15 11:15:54] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65454&edit=1
Thread (5 messages)