mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
typos, corrected examples, fixed structure, entities usage
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@135201 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
119c4851ad
commit
d208b4c328
37 changed files with 227 additions and 259 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-affected-rows">
|
||||
<refnamediv>
|
||||
|
@ -20,13 +20,13 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>pg_affected_rows</function></title>
|
||||
<title><function>pg_affected_rows</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$result = pg_query ($conn, "INSERT INTO authors VALUES ('Orwell', 2002, 'Animal Farm')");
|
||||
$cmdtuples = pg_affected_rows ($result);
|
||||
echo $cmdtuples . " tuples are affected.";
|
||||
$result = pg_query($conn, "INSERT INTO authors VALUES ('Orwell', 2002, 'Animal Farm')");
|
||||
$cmdtuples = pg_affected_rows($result);
|
||||
echo $cmdtuples . " tuples are affected.\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.61 -->
|
||||
<refentry id='function.pg-cancel-query'>
|
||||
<refnamediv>
|
||||
<refname>pg_cancel_query</refname>
|
||||
<refpurpose>
|
||||
Cancel async query
|
||||
Cancel asynchronous query
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -20,8 +20,8 @@
|
|||
<function>pg_query</function>.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_send_query</function>
|
||||
and <function>pg_connection_busy</function>
|
||||
See also <function>pg_send_query</function> and
|
||||
<function>pg_connection_busy</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.16 -->
|
||||
<refentry id="function.pg-client-encoding">
|
||||
<refnamediv>
|
||||
<refname>pg_client_encoding</refname>
|
||||
<refpurpose>
|
||||
Get the client encoding
|
||||
Gets the client encoding
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
|
@ -31,8 +31,7 @@
|
|||
multibyte support and encoding supported.
|
||||
</para>
|
||||
<para>
|
||||
The function used to be called
|
||||
<function>pg_clientencoding</function>.
|
||||
The function used to be called <function>pg_clientencoding</function>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
|
||||
<refentry id="function.pg-close">
|
||||
<refnamediv>
|
||||
|
@ -26,13 +26,13 @@
|
|||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title>PostgreSQL close example</title>
|
||||
<title><function>pg_close</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = $dbconn = pg_connect ("host=localhost port=5432 dbname=mary")
|
||||
or die("Could not connect);
|
||||
print ("Connected successfully");
|
||||
$dbconn = pg_connect("host=localhost port=5432 dbname=mary")
|
||||
or die("Could not connect");
|
||||
print("Connected successfully");
|
||||
pg_close($dbconn);
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-connect">
|
||||
<refnamediv>
|
||||
|
@ -24,21 +24,21 @@
|
|||
not be made. <parameter>connection_string</parameter> should be
|
||||
a quoted string.
|
||||
<example>
|
||||
<title>Using pg_connect</title>
|
||||
<title>Using <function>pg_connect</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect ("dbname=mary");
|
||||
$dbconn = pg_connect("dbname=mary");
|
||||
//connect to a database named "mary"
|
||||
|
||||
$dbconn2 = pg_connect ("host=localhost port=5432 dbname=mary");
|
||||
$dbconn2 = pg_connect("host=localhost port=5432 dbname=mary");
|
||||
// connect to a database named "mary" on "localhost" at port "5432"
|
||||
|
||||
$dbconn3 = pg_connect ("host=sheep port=5432 dbname=mary user=lamb password=foo");
|
||||
$dbconn3 = pg_connect("host=sheep port=5432 dbname=mary user=lamb password=foo");
|
||||
//connect to a database named "mary" on the host "sheep" with a username and password
|
||||
|
||||
$conn_string = "host=sheep port=5432 dbname=test user=lamb password=bar";
|
||||
$dbconn4 = pg_connect ($conn_string);
|
||||
$dbconn4 = pg_connect($conn_string);
|
||||
//connect to a database named "test" on the host "sheep" with a username and password
|
||||
?>
|
||||
]]>
|
||||
|
@ -61,7 +61,7 @@ $dbconn4 = pg_connect ($conn_string);
|
|||
</para>
|
||||
<para>
|
||||
The old syntax with multiple parameters
|
||||
<command>$conn = pg_connect ("host", "port", "options", "tty", "dbname")
|
||||
<command>$conn = pg_connect("host", "port", "options", "tty", "dbname")
|
||||
</command> has been deprecated.
|
||||
</para>
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
|
||||
<refentry id='function.pg-connection-busy'>
|
||||
<refnamediv>
|
||||
|
@ -21,11 +21,11 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>pg_connection_busy</title>
|
||||
<title><function>pg_connection_busy</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
$bs = pg_connection_busy($dbconn);
|
||||
if ($bs) {
|
||||
echo 'connection is busy';
|
||||
|
@ -38,12 +38,9 @@
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<para>
|
||||
See also <function>pg_connection_status</function> and
|
||||
<function>pg_get_result</function>
|
||||
<function>pg_get_result</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
|
||||
<refentry id='function.pg-connection-reset'>
|
||||
<refnamediv>
|
||||
|
@ -24,13 +24,13 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
$dbconn2 = pg_connection_reset($dbconn);
|
||||
if ($dbconn2) {
|
||||
echo 'reset successful';
|
||||
echo "reset successful\n";
|
||||
}
|
||||
else {
|
||||
echo 'reset failed';
|
||||
echo "reset failed\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<para>
|
||||
See also <function>pg_connect</function>,
|
||||
<function>pg_pconnect</function> and
|
||||
<function>pg_connection_status</function>
|
||||
<function>pg_connection_status</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
|
||||
<refentry id='function.pg-connection-status'>
|
||||
<refnamediv>
|
||||
|
@ -21,11 +21,11 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>pg_connection_status</title>
|
||||
<title><function>pg_connection_status</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
$stat = pg_connection_status($dbconn);
|
||||
echo 'connection_status: '.$stat;
|
||||
?>
|
||||
|
@ -33,9 +33,6 @@
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<para>
|
||||
See also <function>pg_connection_busy</function>.
|
||||
</para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.80 -->
|
||||
<refentry id='function.pg-convert'>
|
||||
<refnamediv>
|
||||
|
@ -27,13 +27,9 @@
|
|||
values of <literal>assoc_array</literal>. Returns an array with the converted
|
||||
values on success, &false; otherwise.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This function is experimental.
|
||||
</para>
|
||||
</note>
|
||||
&warn.experimental.func;
|
||||
<para>
|
||||
See also <function>pg_meta_data</function>
|
||||
See also <function>pg_meta_data</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
|
||||
<refentry id='function.pg-copy-from'>
|
||||
<refnamediv>
|
||||
|
@ -25,7 +25,7 @@
|
|||
&return.success;
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_copy_to</function>
|
||||
See also <function>pg_copy_to</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id='function.pg-copy-to'>
|
||||
<refnamediv>
|
||||
|
@ -24,7 +24,7 @@
|
|||
&false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_copy_from</function>
|
||||
See also <function>pg_copy_from</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-dbname">
|
||||
<refnamediv>
|
||||
|
@ -26,8 +26,8 @@
|
|||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
pg_connect ("host=localhost port=5432 dbname=mary");
|
||||
echo pg_dbname();
|
||||
pg_connect("host=localhost port=5432 dbname=mary");
|
||||
echo pg_dbname(); // mary
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.80 -->
|
||||
<refentry id='function.pg-delete'>
|
||||
<refnamediv>
|
||||
|
@ -24,12 +24,13 @@
|
|||
specified, <function>pg_convert</function> is applied
|
||||
to <literal>assoc_array</literal> with specified option.
|
||||
</para>
|
||||
<example>
|
||||
<title>pg_delete</title>
|
||||
<programlisting role="php">
|
||||
<para>
|
||||
<example>
|
||||
<title>pg_delete</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$db = pg_connect ('dbname=foo');
|
||||
$db = pg_connect('dbname=foo');
|
||||
// This is safe, since $_POST is converted automatically
|
||||
$res = pg_delete($db, 'post_log', $_POST);
|
||||
if ($res) {
|
||||
|
@ -40,15 +41,12 @@
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<para>
|
||||
This function is experimental.
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
&warn.experimental.func;
|
||||
<para>
|
||||
See also <function>pg_convert</function>
|
||||
See also <function>pg_convert</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-fetch-all">
|
||||
<refnamediv>
|
||||
|
@ -17,31 +17,25 @@
|
|||
contains all rows (tuples/records) in result resource. It returns
|
||||
&false;, if there are no rows.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_fetch_row</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>PostgreSQL fetch all</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
$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 * FROM authors");
|
||||
if (!$result) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$arr = pg_fetch_all ($result);
|
||||
$arr = pg_fetch_all($result);
|
||||
|
||||
var_dump($arr);
|
||||
|
||||
|
@ -50,6 +44,12 @@ var_dump($arr);
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_fetch_row</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-fetch-array">
|
||||
<refnamediv>
|
||||
|
@ -53,38 +53,34 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>PostgreSQL fetch array</title>
|
||||
<title><function>pg_fetch_array</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
|
||||
$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 * FROM authors");
|
||||
if (!$result) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$arr = pg_fetch_array ($result, 0, PGSQL_NUM);
|
||||
$arr = pg_fetch_array($result, 0, PGSQL_NUM);
|
||||
echo $arr[0] . " <- array\n";
|
||||
|
||||
$arr = pg_fetch_array ($result, 1, PGSQL_ASSOC);
|
||||
$arr = pg_fetch_array($result, 1, PGSQL_ASSOC);
|
||||
echo $arr["author"] . " <- array\n";
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>pg_fetch_row</function>,
|
||||
<function>pg_fetch_object</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
From 4.1.0, <parameter>row</parameter> became optional.
|
||||
|
@ -92,6 +88,12 @@ echo $arr["author"] . " <- array\n";
|
|||
internal row counter by 1.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>pg_fetch_row</function>,
|
||||
<function>pg_fetch_object</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-fetch-assoc">
|
||||
<refnamediv>
|
||||
<refname>pg_fetch_assoc</refname>
|
||||
<refpurpose>Fetch a row as an array</refpurpose>
|
||||
<refpurpose>Fetch a row as an associative array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -19,11 +19,11 @@
|
|||
&false;, if there are no more rows.
|
||||
</para>
|
||||
<para>
|
||||
<function>pg_fetch_assoc</function> is an extended version of
|
||||
<function>pg_fetch_row</function>. In addition to storing the
|
||||
data in the numeric indices (field index) to the result array, it
|
||||
also stores the data in associative indices (field name) by
|
||||
default.
|
||||
<function>pg_fetch_assoc</function> is equivalent to calling
|
||||
<function>pg_fetch_array</function> with PGSQL_ASSOC for the
|
||||
optional third parameter. It only returns an associative array.
|
||||
If you need the numeric indices, use
|
||||
<function>pg_fetch_row</function>.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>row</parameter> is row (record) number to be
|
||||
|
@ -36,23 +36,23 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>PostgreSQL fetch array</title>
|
||||
<title><function>pg_fetch_assoc</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
$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 * FROM authors");
|
||||
if (!$result) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$arr = pg_fetch_assoc ($result, 1, PGSQL_ASSOC);
|
||||
$arr = pg_fetch_assoc($result, 1);
|
||||
echo $arr["author"] . " <- array\n";
|
||||
?>
|
||||
]]>
|
||||
|
@ -62,9 +62,9 @@ echo $arr["author"] . " <- array\n";
|
|||
<para>
|
||||
See also
|
||||
<function>pg_fetch_row</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function>, and
|
||||
<function>pg_fetch_result</function>.
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-fetch-object">
|
||||
<refnamediv>
|
||||
|
@ -51,60 +51,38 @@
|
|||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title>Postgres fetch object</title>
|
||||
<title><function>pg_fetch_object</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$database = "verlag";
|
||||
$db_conn = pg_connect ("host=localhost port=5432 dbname=$database");
|
||||
if (!$db_conn): ?>
|
||||
<H1>Failed connecting to postgres database <?php echo $database ?></H1> <?php
|
||||
|
||||
$database = "store";
|
||||
|
||||
$db_conn = pg_connect("host=localhost port=5432 dbname=$database");
|
||||
if (!$db_conn) {
|
||||
echo "Failed connecting to postgres database $database\n";
|
||||
exit;
|
||||
endif;
|
||||
}
|
||||
|
||||
$qu = pg_query ($db_conn, "SELECT * FROM verlag ORDER BY autor");
|
||||
$row = 0; // postgres needs a row counter other dbs might not
|
||||
$qu = pg_query($db_conn, "SELECT * FROM books ORDER BY author");
|
||||
|
||||
while ($data = pg_fetch_object ($qu, $row)) {
|
||||
echo $data->autor." (";
|
||||
echo $data->jahr ."): ";
|
||||
echo $data->titel."<BR>";
|
||||
$row = 0; // postgres needs a row counter
|
||||
|
||||
while ($data = pg_fetch_object($qu, $row)) {
|
||||
echo $data->author . " (";
|
||||
echo $data->year . "): ";
|
||||
echo $data->title . "<br />";
|
||||
$row++;
|
||||
}
|
||||
?>
|
||||
<PRE>
|
||||
<?php
|
||||
$fields[] = Array ("autor", "Author");
|
||||
$fields[] = Array ("jahr", " Year");
|
||||
$fields[] = Array ("titel", " Title");
|
||||
|
||||
$row= 0; // postgres needs a row counter other dbs might not
|
||||
while ($data = pg_fetch_object ($qu, $row)) {
|
||||
echo "----------\n";
|
||||
reset ($fields);
|
||||
while (list (,$item) = each ($fields)):
|
||||
echo $item[1].": ".$data->$item[0]."\n";
|
||||
endwhile;
|
||||
$row++;
|
||||
}
|
||||
echo "----------\n";
|
||||
?>
|
||||
</PRE>
|
||||
<?php
|
||||
pg_free_result ($qu);
|
||||
pg_close ($db_conn);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>pg_query</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_row</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
From 4.1.0, <parameter>row</parameter> became optional.
|
||||
|
@ -112,6 +90,14 @@ pg_close ($db_conn);
|
|||
internal row counter counter by 1.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>pg_query</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_assoc</function>,
|
||||
<function>pg_fetch_row</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-fetch-row">
|
||||
<refnamediv>
|
||||
|
@ -26,17 +26,17 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Postgres fetch row</title>
|
||||
<title><function>pg_fetch_row</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
$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 * FROM authors");
|
||||
if (!$result) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
|
@ -44,10 +44,10 @@ if (!$result) {
|
|||
|
||||
while ($row = pg_fetch_row($result, $i)) {
|
||||
for ($j=0; $j < count($row); $j++) {
|
||||
echo "$row[$j] ";
|
||||
echo $row[$j] . " ";
|
||||
}
|
||||
|
||||
echo "<BR>";
|
||||
echo "<br />\n";
|
||||
|
||||
}
|
||||
|
||||
|
@ -56,13 +56,6 @@ while ($row = pg_fetch_row($result, $i)) {
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<function>pg_query</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function>, and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
From 4.1.0, <parameter>row</parameter> became optional.
|
||||
|
@ -70,6 +63,13 @@ while ($row = pg_fetch_row($result, $i)) {
|
|||
internal row counter by 1.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>pg_query</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function> and
|
||||
<function>pg_fetch_result</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-field-is-null">
|
||||
<refnamediv>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>pg_field_is_null</title>
|
||||
<title><function>pg_field_is_null</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -31,10 +31,10 @@
|
|||
$res = pg_query($dbconn, "select * from authors where author = 'Orwell'");
|
||||
if ($res) {
|
||||
if (pg_field_is_null($res, 0, "year") == 1) {
|
||||
echo 'The value of the field year is null.';
|
||||
echo "The value of the field year is null.\n";
|
||||
}
|
||||
if (pg_field_is_null($res, 0, "year") == 0) {
|
||||
echo 'The value of the field year is not null.';
|
||||
echo "The value of the field year is not null.\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -42,8 +42,6 @@
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
|
||||
<note>
|
||||
<para>
|
||||
This function used to be called <literal>pg_fieldisnull()</literal>.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-field-name">
|
||||
<refnamediv>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
|
||||
$res = pg_query($dbconn, "select * from authors where author = 'Orwell'");
|
||||
$i = pg_num_fields($res);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-field-size">
|
||||
<refnamediv>
|
||||
|
@ -31,7 +31,8 @@
|
|||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>pg_field_prtlen</function> and <function>pg_field_type</function>.
|
||||
See also <function>pg_field_prtlen</function> and
|
||||
<function>pg_field_type</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.52 -->
|
||||
<refentry id="function.pg-field-type">
|
||||
<refnamediv>
|
||||
|
@ -30,7 +30,8 @@
|
|||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>pg_field_prtlen</function> and <function>pg_field_name</function>.
|
||||
See also <function>pg_field_prtlen</function> and
|
||||
<function>pg_field_name</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id="function.pg-get-notify">
|
||||
<refnamediv>
|
||||
<refname>pg_get_notify</refname>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
$conn = pg_pconnect("dbname=publisher");
|
||||
if (!$conn) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.pg-get-pid">
|
||||
<refnamediv>
|
||||
<refname>pg_get_pid</refname>
|
||||
|
@ -16,16 +16,13 @@
|
|||
process) PID. PID is useful to check if <literal>NOTIFY</literal>
|
||||
message is sent from other process or not.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_get_notify</function>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>PostgreSQL backend PID</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
$conn = pg_pconnect("dbname=publisher");
|
||||
if (!$conn) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
|
@ -38,6 +35,9 @@ $pid = pg_get_pid($conn);
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_get_notify</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.80 -->
|
||||
<refentry id='function.pg-insert'>
|
||||
<refnamediv>
|
||||
|
@ -23,16 +23,17 @@
|
|||
<literal>table_name</literal> must at least have as many columns as <literal>assoc_array</literal>
|
||||
has elements. The fieldnames as well as the fieldvalues in <literal>table_name</literal>
|
||||
must match the indices and values of <literal>assoc_array</literal>.
|
||||
<function>pg_insert</function> returns &true; on success, &false; on failure.
|
||||
&return.success;
|
||||
If options is specified, <function>pg_insert</function> is applied to
|
||||
<literal>assoc_array</literal> with specified option.
|
||||
</para>
|
||||
<example>
|
||||
<title>pg_insert</title>
|
||||
<programlisting role="php">
|
||||
<para>
|
||||
<example>
|
||||
<title><function>pg_insert</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect ('dbname=foo');
|
||||
$dbconn = pg_connect('dbname=foo');
|
||||
// This is safe, since $_POST is converted automatically
|
||||
$res = pg_insert($dbconn, 'post_log', $_POST);
|
||||
if ($res) {
|
||||
|
@ -43,15 +44,12 @@
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<para>
|
||||
This function is experimental.
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
&warn.experimental.func;
|
||||
<para>
|
||||
See also <function>pg_convert</function>
|
||||
See also <function>pg_convert</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-lo-create">
|
||||
<refnamediv>
|
||||
|
@ -23,7 +23,6 @@
|
|||
access. INV_ARCHIVE has been removed from PostgreSQL itself
|
||||
(version 6.3 and above). It returns large object oid,
|
||||
otherwise it returns &false; if an error occurred.
|
||||
|
||||
</para>
|
||||
<para>
|
||||
To use the large object (lo) interface, it is necessary to
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.80 -->
|
||||
<refentry id='function.pg-meta-data'>
|
||||
<refnamediv>
|
||||
|
@ -17,7 +17,7 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_meta_data</function> returns table definition for
|
||||
<literal>table_name</literal> as array. If there is error, it
|
||||
<literal>table_name</literal> as an array. If there is error, it
|
||||
returns &false;
|
||||
</para>
|
||||
<para>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
|
||||
$meta = pg_meta_data($dbconn,'authors');
|
||||
if (is_array ($meta)) {
|
||||
|
@ -87,14 +87,9 @@ array(3) {
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
This function is experimental.
|
||||
</para>
|
||||
</note>
|
||||
&warn.experimental.func;
|
||||
<para>
|
||||
See also <function>pg_convert</function>
|
||||
See also <function>pg_convert</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-ping">
|
||||
<refnamediv>
|
||||
|
@ -17,17 +17,13 @@
|
|||
reconnect if it is broken. It returns &true; if connection is
|
||||
alive, otherwise &false;.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_connection_status</function> and
|
||||
<function>pg_connection_reset</function>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>PostgreSQL ping</title>
|
||||
<title><function>pg_ping</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=publisher");
|
||||
$conn = pg_pconnect("dbname=publisher");
|
||||
if (!$conn) {
|
||||
echo "An error occured.\n";
|
||||
exit;
|
||||
|
@ -40,6 +36,10 @@ if (!pg_ping($conn))
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_connection_status</function> and
|
||||
<function>pg_connection_reset</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.20 -->
|
||||
<refentry id="function.pg-put-line">
|
||||
<refnamediv>
|
||||
|
@ -28,13 +28,12 @@
|
|||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>pg_end_copy</function>.
|
||||
<example>
|
||||
<title>High-speed insertion of data into a table</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = pg_pconnect ("dbname=foo");
|
||||
$conn = pg_pconnect("dbname=foo");
|
||||
pg_query($conn, "create table bar (a int4, b char(16), d float8)");
|
||||
pg_query($conn, "copy bar from stdin");
|
||||
pg_put_line($conn, "3\thello world\t4.5\n");
|
||||
|
@ -46,6 +45,9 @@
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_end_copy</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-query">
|
||||
<refnamediv>
|
||||
|
@ -44,7 +44,7 @@
|
|||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
<note>
|
||||
<note>
|
||||
<para>
|
||||
This function used to be called <literal>pg_exec()</literal>.
|
||||
<literal>pg_exec()</literal> is still available for compatibility
|
||||
|
@ -56,8 +56,8 @@
|
|||
<function>pg_pconnect</function>,
|
||||
<function>pg_fetch_array</function>,
|
||||
<function>pg_fetch_object</function>,
|
||||
<function>pg_num_rows</function>,
|
||||
and <function>pg_affected_rows</function>.
|
||||
<function>pg_num_rows</function> and
|
||||
<function>pg_affected_rows</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-result-seek">
|
||||
<refnamediv>
|
||||
|
@ -15,7 +15,7 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_result_seek</function> set internal row offset in
|
||||
reuslt resource. It returns &false;, if there is error.
|
||||
result resource. It returns &false;, if there is error.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>pg_fetch_row</function>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.58 -->
|
||||
<refentry id='function.pg-result-status'>
|
||||
<refnamediv>
|
||||
|
@ -16,7 +16,7 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>pg_result_status</function> returns status of result
|
||||
resource. Possible retun values are PGSQL_EMPTY_QUERY,
|
||||
resource. Possible return values are PGSQL_EMPTY_QUERY,
|
||||
PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_COPY_TO,
|
||||
PGSQL_COPY_FROM, PGSQL_BAD_RESPONSE, PGSQL_NONFATAL_ERROR and
|
||||
PGSQL_FATAL_ERROR.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.80 -->
|
||||
<refentry id='function.pg-select'>
|
||||
<refnamediv>
|
||||
|
@ -27,12 +27,13 @@
|
|||
<function>pg_convert</function> is applied to
|
||||
<literal>assoc_array</literal> with specified option.
|
||||
</para>
|
||||
<example>
|
||||
<title>pg_select</title>
|
||||
<programlisting role="php">
|
||||
<para>
|
||||
<example>
|
||||
<title><function>pg_select</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$db = pg_connect ('dbname=foo');
|
||||
$db = pg_connect('dbname=foo');
|
||||
// This is safe, since $_POST is converted automatically
|
||||
$rec = pg_select($db, 'post_log', $_POST);
|
||||
if ($rec) {
|
||||
|
@ -44,13 +45,10 @@
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<para>
|
||||
This function is experimental.
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
&warn.experimental.func;
|
||||
<para>
|
||||
See also <function>pg_convert</function>
|
||||
</para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id='function.pg-send-query'>
|
||||
<refnamediv>
|
||||
|
@ -42,20 +42,21 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
|
||||
if (!pg_connection_busy($dbconn)) {
|
||||
pg_send_query($dbconn,"select * from authors; select count(*) from authors;");
|
||||
}
|
||||
|
||||
$res1 = pg_get_result($dbconn);
|
||||
echo 'first call to pg_get_result(): '.$res1.'<br>';
|
||||
echo "First call to pg_get_result : $res1\n";
|
||||
$rows1 = pg_num_rows($res1);
|
||||
echo $res1.' has '.$rows1.' records<br><br>';
|
||||
|
||||
echo "$res1 has $rows1 records\n\n";
|
||||
|
||||
$res2 = pg_get_result($dbconn);
|
||||
echo 'second call to pg_get_result(): '.$res2.'<br>';
|
||||
echo "second call to pg_get_result : $res2\n";
|
||||
$rows2 = pg_num_rows($res2);
|
||||
echo $res2.' has '.$rows2.' records<br>';
|
||||
echo "$res2 has $rows2 records\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -77,7 +78,7 @@ Resource id #4 has 1 records
|
|||
See also <function>pg_query</function>,
|
||||
<function>pg_cancel_query</function>,
|
||||
<function>pg_get_result</function> and
|
||||
<function>pg_connection_busy</function>
|
||||
<function>pg_connection_busy</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.16 -->
|
||||
<refentry id="function.pg-set-client-encoding">
|
||||
<refnamediv>
|
||||
|
@ -35,7 +35,7 @@
|
|||
</para>
|
||||
<para>
|
||||
The function used to be called
|
||||
<function>pg_setclientencoding</function>.
|
||||
<literal>pg_setclientencoding()</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.7 -->
|
||||
<refentry id="function.pg-trace">
|
||||
<refnamediv>
|
||||
|
@ -34,8 +34,9 @@
|
|||
trace and defaults to the last one opened.
|
||||
</para>
|
||||
<para>
|
||||
It returns &true; if <parameter>pathname</parameter> could be opened
|
||||
for logging, &false; otherwise.
|
||||
<function>pg_trace</function> returns &true; if
|
||||
<parameter>pathname</parameter> could be opened for logging,
|
||||
&false; otherwise.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>fopen</function> and
|
||||
|
|
|
@ -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.80 -->
|
||||
<refentry id='function.pg-update'>
|
||||
<refnamediv>
|
||||
|
@ -25,13 +25,15 @@
|
|||
<function>pg_convert</function> is applied to
|
||||
<literal>data</literal> with specified options.
|
||||
</para>
|
||||
<example>
|
||||
<title>pg_update</title>
|
||||
<programlisting role="php">
|
||||
<para>
|
||||
<example>
|
||||
<title><function>pg_update</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$db = pg_connect ('dbname=foo');
|
||||
$db = pg_connect('dbname=foo');
|
||||
$data = array('field1'=>'AA', 'field2'=>'BB');
|
||||
|
||||
// This is safe, since $_POST is converted automatically
|
||||
$res = pg_update($db, 'post_log', $_POST, $data);
|
||||
if ($res) {
|
||||
|
@ -42,15 +44,12 @@
|
|||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<para>
|
||||
This function is experimental.
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
&warn.experimental.func;
|
||||
<para>
|
||||
See also <function>pg_convert</function>
|
||||
See also <function>pg_convert</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue