Comunitatea PHP Romania
 

 
oci_num_fields

oci_num_fields

(PHP 5)

oci_num_fields --  Returns the number of result columns in a statement

Description

int oci_num_fields ( resource statement)

oci_num_fields() returns the number of columns in the statement.

Exemplu 1. oci_num_fields() example

<?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() returns FALSE on error.

Notã: 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.

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Credit Cards | Personal Finance | Per Insurance | Loans | Fantasy Football
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis