oci_num_fields

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

oci_num_fields — ���ؽ���е���Ŀ

˵��

oci_num_fields ( resource $statement ) : int

oci_num_fields() ���� statement �е��е���Ŀ��

Example #1 oci_num_fields() ����

<?php
    
echo "<pre>\n";
    
$conn = oci_connect("scott", "tiger");
    
$stmt = oci_parse($conn, "select * from emp");

    
oci_execute($stmt);

    while (
oci_fetch($stmt)) {
        echo 
"\n";
        
$ncols = oci_num_fields($stmt);
        for (
$i = 1; $i <= $ncols; $i++) {
            
$column_name  = oci_field_name($stmt, $i);
            
$column_value = oci_result($stmt, $i);
            echo 
$column_name . ': ' . $column_value . "\n";
        }
        echo 
"\n";
    }

    
oci_free_statement($stmt);
    
oci_close($conn);

    echo 
"</pre>";
?>

oci_num_fields() �ڳ���ʱ���� FALSE��

Note:

�� PHP 5.0.0 ֮ǰ�İ汾����ʹ�� ocinumcols() ������������ú�������Ȼ���ã�Ϊ���¼�����Ϊ oci_num_fields() �ı������������ѱ����������Ƽ�ʹ�á�