Документация PHP


pg_fetch_object

pg_fetch_row

PostgreSQL

PHP Manual


pg_fetch_result

(PHP 4 >= 4.2.0, PHP 5)

pg_fetch_result — Returns values from a result resource

Описание

string pg_fetch_result ( resource $result , int $row , mixed $field )

string pg_fetch_result ( resource $result , mixed $field )

pg_fetch_result() returns the value of a particular row and field (column) in a PostgreSQL result resource.

Замечание: This function used to be called pg_result().

Список параметров

result

PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).

row

Row number in result to fetch. Rows are numbered from 0 upwards. If omitted, next row is fetched.

field

A string representing the name of the field (column) to fetch, otherwise an int representing the field number to fetch. Fields are numbered from 0 upwards.

Возвращаемые значения

Boolean is returned as "t" or "f". All other types, including arrays are returned as strings formatted in the same default PostgreSQL manner that you would see in the psql program. Database NULL values are returned as NULL.

FALSE is returned if row exceeds the number of rows in the set, or on any other error.

Примеры

Пример #1 pg_fetch_result() example

<?php
$db 
pg_connect("dbname=users user=me") || die();

$res pg_query($db"SELECT 1 UNION ALL SELECT 2");

$val pg_fetch_result($res10);

echo 
"First field in the second row is: "$val"\n";
?>

Результат выполнения данного примера:

First field in the second row is: 2

Смотрите также


pg_fetch_object

pg_fetch_row

PostgreSQL

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…