php-doc-en/reference/ingres-ii/functions/ingres-errno.xml
Nilgün Belma Bugüner f4871bb5ba fixed properties
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@283819 c90b9560-bf6c-de11-be94-00142212c4b1
2009-07-11 07:47:57 +00:00

114 lines
2.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<refentry xml:id="function.ingres-errno" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ingres_errno</refname>
<refpurpose>Get the last Ingres error number generated</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>ingres_errno</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link</parameter></methodparam>
</methodsynopsis>
<para>
Returns an integer containing the last error number. If no error was
reported 0 is returned.
</para>
<para>
If a <parameter>link</parameter> resource is passed to
<function>ingres_errno</function> it returns the last error recorded for
the link. If no link is passed, then <function>ingres_errno</function>
returns the last error reported using the default link.
</para>
<para>
The function, <function>ingres_errno</function>, should always be called
after executing a database query. Calling another function before
<function>ingres_errno</function> is called will reset or change any
error code from the last Ingres function call.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link</parameter></term>
<listitem>
<para>
The connection link identifier
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an integer containing the last error number. If no error was
reported, 0 is returned.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Get the last Ingres error number generated</title>
<programlisting role="php">
<![CDATA[
<?php
$link = ingres_connect($database, $user, $password);
$result = ingres_query($link, "select * from table");
$error_code = ingres_errno($link);
if ( $error_code != 0 ) {
echo "An error occured - " . $error_code;
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ingres_error</function></member>
<member><function>ingres_errsqlstate</function></member>
<member><function>ingres_next_error</function></member>
</simplelist>
</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
-->