Search DaTutorials:  
HOME
Php Tutorials
Articles
Basics
Date and Time
File Manipulations
Forms
Functions
General
Interactivity
MySql
Navigation
News,Shoutboxes and Blogs
Language Structure and Data Types
Searching
Security
String Manipulation
User Information and Stats
Search For a Tutorial
Php Reference

pg_fetch_all

(PHP 4 >= 4.3.0, PHP 5)

pg_fetch_all -- Fetches all rows from a result as an array

Description

array pg_fetch_all ( resource result)

pg_fetch_all() returns an array that contains all rows (tuples/records) in result resource. It returns FALSE, if there are no rows.

Example 1. PostgreSQL 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);

?>

See also pg_fetch_row(), pg_fetch_array(), pg_fetch_object() and pg_fetch_result().



Copyright © 2001-2004 The PHP Group
All rights reserved.

     Discuss TV Forums | Personal Loans | Xecuter 3 Mod Chip | Agencia de turismo | Free Advertising
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp