Fix proto, update example incorporating notes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@176735 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kenneth Schwartz 2005-01-09 16:43:25 +00:00
parent 7f0d2762f6
commit 5bb1f07bbf

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-fetch-row">
<refnamediv>
@ -11,7 +11,7 @@
<methodsynopsis>
<type>array</type><methodname>pg_fetch_row</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam><type>int</type><parameter>row</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_fetch_row</function> fetches one row of data from
@ -30,26 +30,23 @@
<title><function>pg_fetch_row</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT * FROM authors");
$result = pg_query($conn, "SELECT author, email FROM authors");
if (!$result) {
echo "An error occured.\n";
exit;
}
while ($row = pg_fetch_row($result, $i)) {
for ($j=0; $j < count($row); $j++) {
echo $row[$j] . "&nbsp;";
}
echo "<br />\n";
while ($row = pg_fetch_row($result)) {
echo "Author: $row[0] E-mail: $row[1]";
echo "<br />\n";
}
?>
@ -61,7 +58,7 @@ while ($row = pg_fetch_row($result, $i)) {
<para>
From 4.1.0, <parameter>row</parameter> became optional.
Calling <function>pg_fetch_row</function> will increment
internal row counter by 1.
the internal row counter by one.
</para>
</note>
<para>