PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

sqlsrv_num_fields - Retrieves the number of fields (columns) on a statement | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

sqlsrv_num_fields

(バージョン情報なし。おそらく SVN 版にしか存在しないでしょう)

sqlsrv_num_fieldsRetrieves the number of fields (columns) on a statement

説明

mixed sqlsrv_num_fields ( resource $stmt )

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

パラメータ

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.

返り値

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

例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 />";
}
?>

参考


忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「sqlsrv_num_fields - Retrieves the number of fields (columns) on a statement」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | sqlsrv_num_fields - Retrieves the number of fields (columns) on a statement」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: