Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: pg_result_seek - Manual
[go: Go Back, main page]

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

search for in the

pg_result_status" width="11" height="7"/> <pg_result_error
Last updated: Fri, 29 Aug 2008

view this page in

pg_result_seek

(PHP 4 >= 4.3.0, PHP 5)

pg_result_seek結果リソースの内部行オフセットを設定する

説明

bool pg_result_seek ( resource $result , int $offset )

pg_result_seek()は、結果リソースの行の位置を 指定された offset にセットします。

パラメータ

result

pg_query(), pg_query_params() あるいは pg_execute() から返される PostgreSQL の クエリ結果リソース。

offset

結果リソース内で、内部オフセットを移動させる行。 行番号はゼロから始まります。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 pg_result_seek() の例

<?php

// データベースに接続する
$conn pg_pconnect("dbname=publisher");

// クエリを実行する
$result pg_query($conn"SELECT author, email FROM authors");

// 3 行目をシークする(結果が 3 行あると仮定する)
pg_result_seek($result2);

// 3 行目を取得する
$row pg_fetch_row($result);
 
?>



add a note add a note User Contributed Notes
pg_result_seek
andrew-php dot net at andrew dot net dot au
18-Sep-2004 12:01
Ah, this is a handy feature for resetting the record index, for example, if you're used pg_fetch_{row,array,assoc} to iterate over the result set, and you want to do it again later on, without reexecuting your query. Something like:

<?php pg_result_seek($result, 0); ?>

will allow you to iterate over the result set all over again...

 
show source | credits | sitemap | contact | advertising | mirror sites