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

sqlsrv_num_rows - Retrieves the number of rows in a result set | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

sqlsrv_num_rows

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

sqlsrv_num_rowsRetrieves the number of rows in a result set

説明

mixed sqlsrv_num_rows ( resource $stmt )

Retrieves the number of rows in a result set. This function requires that the statment resource be created with a static or keyset cursor. For more information, see sqlsrv_query(), sqlsrv_prepare(), or » Specifying a Cursor Type and Selecting Rows in the Microsoft SQLSRV documentation.

パラメータ

stmt

The statement for which the row count is returned. The statment resource must be created with a static or keyset cursor. For more information, see sqlsrv_query(), sqlsrv_prepare(), or » Specifying a Cursor Type and Selecting Rows in the Microsoft SQLSRV documentation.

返り値

Returns the number of rows retrieved on success and FALSE if an error occurred. If a forward cursor (the default) or dynamic cursor is used, FALSE is returned.

例1 sqlsrv_num_rows() example

<?php
$server 
"serverName\sqlexpress";
$connectionInfo = array( "Database"=>"dbName""UID"=>"username""PWD"=>"password" );
$conn sqlsrv_connect$server$connectionInfo );

$sql "SELECT * FROM Table_1";
$params = array();
$options =  array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$stmt sqlsrv_query$conn$sql $params$options );

$row_count sqlsrv_num_rows$stmt );
   
if (
$row_count === false)
   echo 
"Error in retrieveing row count.";
else
   echo 
$row_count;
?>

参考


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

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