IT. Expert System.

PHP

Retrieves the number of fields (columns) on a statement


sqlsrv_num_fields

(No version information available, might only be in Git)

sqlsrv_num_fieldsRetrieves the number of fields (columns) on a statement

Description

mixed sqlsrv_num_fields ( resource $stmt )

Retrieves the number of fields (columns) on a statement.

Parameters

stmt

The statment for which the number of fields is returned. sqlsrv_num_fields() can be called on a statement before or after statement execution.

Return Values

Returns the number of fields on success. Returns FALSE otherwise.

Examples

Example #1 sqlsrv_num_fields() example

<?php
$serverName 
"serverName\sqlexpress";
$connectionInfo = array( "Database"=>"dbName""UID"=>"username""PWD"=>"password");
$conn sqlsrv_connect$serverName$connectionInfo);
if( 
$conn === false ) {
   die( 
print_rsqlsrv_errors(), true));
}

$sql "SELECT * FROM Table_1";
$stmt sqlsrv_query($conn$sql);
if( 
$stmt === false) {
   die( 
print_rsqlsrv_errors(), true));
}

$numFields sqlsrv_num_fields$stmt );

while( 
sqlsrv_fetch$stmt )) {
   
// Iterate through the fields of each row.
   
for($i 0$i $numFields$i++) { 
   {
      echo 
sqlsrv_get_field($stmt$i)." ";
     }
     echo 
"<br />";
}
?>

See Also



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: 210 / . Delta: 0.03556 с