PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<pg_executepg_fetch_array>
Last updated: Mon, 16 Jul 2012

pg_fetch_all

(PHP 4 >= 4.3.0, PHP 5)

pg_fetch_all -- 从结果中提取所有行作为一个数组

说明

array pg_fetch_all ( resource result )

pg_fetch_all() 从结果资源中返回一个包含有所有的行(元组/记录)的数组。如果没有更多行可供提取,则返回 FALSE

例子 1. pg_fetch_all() 例子

<?php
$conn
= pg_pconnect("dbname=publisher");
if (!
$conn) {
   echo
"An error occured.\n";
   exit;
}
$result = pg_query($conn, "SELECT * FROM authors");
if (!
$result) {
   echo
"An error occured.\n";
   exit;
}
$arr = pg_fetch_all($result);
var_dump($arr);
?>

参见 pg_fetch_row()pg_fetch_array()pg_fetch_object()pg_fetch_result()




<pg_executepg_fetch_array>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST