IT. Expert System.

PHP

Returns the number of result columns in a statement


oci_num_fields

(PHP 5, PECL OCI8 >= 1.1.0)

oci_num_fieldsReturns the number of result columns in a statement

Description

int oci_num_fields ( resource $statement )

Gets the number of columns in the given statement.

Parameters

statement

A valid OCI statement identifier.

Return Values

Returns the number of columns as an integer, or FALSE on errors.

Examples

Example #1 oci_num_fields() example

<?php
$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);
?>

Notes

Note:

In PHP versions before 5.0.0 you must use ocinumcols() instead. This name still can be used, it was left as alias of oci_num_fields() for downwards compatability. This, however, is deprecated and not recommended.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1593 / . Delta: 0.03038 с