downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ifx_blobinfile_mode> <Informix 関数
Last updated: Fri, 13 Nov 2009

view this page in

ifx_affected_rows

(PHP 4, PHP <=5.2.0)

ifx_affected_rowsクエリで変更された行の数を得る

説明

int ifx_affected_rows ( resource $result_id )

result_id に関連するクエリにより変更された 行の数を返します。

insert, update ,delete の場合、その数は、実際に作用された行の数 (sqlerrd[2]) です。select の場合、これは推定値 (sqlerrd[0]) です。 この値を信用してはいけません。データベースサーバは、SELECT により 実際に返される行の数を返すことはありません。これは、この段階 (オプティマイザがクエリ手順を定義している場合には、"PREPARE" を 行った直後) では、行の取得を始めてさえもいないためです。

ifx_prepare() の実行後に、クエリ結果を適当な量に 制限するために使用すると便利です。

パラメータ

result_id

ifx_query() または ifx_prepare() により返される有効な結果 ID です。

返り値

行の数を整数値で返します。

例1 Informix で変更された行

<?php
$rid 
ifx_prepare("select * from emp
                     where name like " 
$name$connid);
if (! 
$rid) {
    
/* ... error ... */
}
$rowcount ifx_affected_rows($rid);
if (
$rowcount 1000) {
    
printf ("Too many rows in result set (%d)\n<br />"$rowcount);
    die (
"Please restrict your query<br />\n");
}
?>

参考

  • ifx_num_rows() - クエリから既に取得された行の数を数える



add a note add a note User Contributed Notes
ifx_affected_rows
There are no user contributed notes for this page.

ifx_blobinfile_mode> <Informix 関数
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites