php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #348 NumRows returns -1
Submitted: 1998-05-05 09:34 UTC Modified: 1998-05-05 09:59 UTC
From: chris at naas dot no Assigned:
Status: Closed Package: ODBC related
PHP Version: 3.0 Release Candidate 4 OS: NT Server 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chris at naas dot no
New email:
PHP Version: OS:

 

 [1998-05-05 09:34 UTC] chris at naas dot no
We are using ODBC to connect to an Oracle 7.3 database
through Sql*Net (by Oracle).

Source example:

	$dd = odbc_connect("ORCL","news","news");
	$lars = odbc_exec($dd,"select ntb_header from ntb_news order by ntb_id desc");
	$numr = odbc_num_rows($lars);

$numr always returns -1. This is not correct.

odbc_result_all($lars);

prints out the correct result.

This problem also affects other functions, like

odbc_fetch_row($lars, $i);

if $i=1 it complains that:

Warning: Field index is larger than the number of fields in c:\apache\htdocs\news.phtml on line 18


.. and we are unable to get any data using any other
function than odbc_result()..



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-05 09:59 UTC] kara
From M$ ODBC API:

"For UPDATE, INSERT, and DELETE statements, pcrow is the number of rows affected by the
request or -1 if the number of affected rows is not available.
For other statements and functions, the driver may define the value of pcrow.
For example, some data sources may be able to return the number of rows returned by a 
SELECT statement or a catalog function before fetching the rows.
Note:
Many data sources cannot return the number of rows in a result set before fetching them;
for maximum interoperability, applications should not rely on this behavior."

Your Oracle driver is one of them.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 22 14:01:24 2020 UTC