Connecting Tech Pros Worldwide Forums | Help | Site Map

oci_num_rows(ocirowcount) is always showing 0 records in PHP with Oracle

Newbie
 
Join Date: Feb 2008
Posts: 5
#1: Feb 9 '08
oci_num_rows(ocirowcount) is always showing 0 records(while having more rows) in PHP with Oracle to fetch total no of records.
Code wrote as follows:

$qry2="select * from USER";
$smt2=ociparse($conn,$qry2);
$r=ociexecute($smt2);
echo 'Total Rows='.ocirowcount($smt2);

Output show always: Total Rows=0

ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Mar 10 '08

re: oci_num_rows(ocirowcount) is always showing 0 records in PHP with Oracle


Quote:

Originally Posted by PHP manual

Note: This function does not return number of rows selected! For SELECT statements this function will return the number of rows, that were fetched to the buffer with oci_fetch*() functions.

Should be the reason.

Ronald
Reply