php-doc-en/reference/pgsql/functions/pg-query.xml
Nicolas Chaillan f16bc3c61b Typo. Thanks @Jome
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@131648 c90b9560-bf6c-de11-be94-00142212c4b1
2003-06-15 10:18:04 +00:00

84 lines
3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-query">
<refnamediv>
<refname>pg_query</refname>
<refpurpose>Execute a query</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>pg_query</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_query</function> returns a query result resource if
query could be executed. It returns &false; on failure or if
connection is not a valid connection. Details about the error can
be retrieved using the <function>pg_last_error</function>
function if connection is valid.
<function>pg_last_error</function> sends an SQL statement to
the PostgreSQL database specified by the
<parameter>connection</parameter> resource. The
<parameter>connection</parameter> must be a valid connection that
was returned by <function>pg_connect</function> or
<function>pg_pconnect</function>. The return value of this
function is an query result resource to be used to access the
results from other PostgreSQL functions such as
<function>pg_fetch_array</function>.
<note>
<simpara>
<parameter>connection</parameter> is an optional parameter for
<function>pg_query</function>. If
<parameter>connection</parameter> is not set, default
connection is used. Default connection is the last connection
made by <function>pg_connect</function> or
<function>pg_pconnect</function>.
</simpara>
<simpara>
Although <parameter>connection</parameter> can be omitted, it
is not recommended, since it could be a cause of hard to find
bug in script.
</simpara>
</note>
</para>
<note>
<para>
This function used to be called <literal>pg_exec()</literal>.
<literal>pg_exec()</literal> is still available for compatibility
reasons but users are encouraged to use the newer name.
</para>
</note>
<para>
See also <function>pg_connect</function>,
<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>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->