oci_num_rows

(PHP 5, PHP 7, PECL OCI8 >= 1.1.0)

oci_num_rows锟斤拷锟斤拷锟斤拷锟街达拷泻锟斤拷锟接帮拷锟斤拷锟斤拷锟斤拷

说锟斤拷

oci_num_rows ( resource $stmt ) : int

oci_num_rows() 锟斤拷锟斤拷锟斤拷锟街达拷泻锟斤拷锟接帮拷锟斤拷锟斤拷锟斤拷锟斤拷

Note:

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 SELECT 锟斤拷询锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 SELECT 锟斤拷浔撅拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� oci_fetch*() 锟斤拷锟斤拷取锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷

Example #1 oci_num_rows() 锟斤拷锟斤拷

<?php
    
echo "<pre>";
    
$conn oci_connect("scott""tiger");

    
$stmt oci_parse($conn"create table emp2 as select * from emp");
    
oci_execute($stmt);
    echo 
oci_num_rows($stmt) . " rows inserted.<br />";
    
oci_free_statement($stmt);

    
$stmt oci_parse($conn"delete from emp2");
    
oci_execute($stmtOCI_DEFAULT);
    echo 
oci_num_rows($stmt) . " rows deleted.<br />";
    
oci_commit($conn);
    
oci_free_statement($stmt);

    
$stmt oci_parse($conn"drop table emp2");
    
oci_execute($stmt);
    
oci_free_statement($stmt);

    
oci_close($conn);
    echo 
"</pre>";
?>

oci_num_rows() 锟节筹拷锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

Note:

锟斤拷 PHP 5.0.0 之前锟侥版本锟斤拷锟斤拷使锟斤拷 ocirowcount() 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷煤锟斤拷锟斤拷锟斤拷锟饺伙拷锟斤拷茫锟轿拷锟斤拷录锟斤拷锟斤拷锟轿� oci_num_rows() 锟侥憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟窖憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟狡硷拷使锟矫★拷