php-doc-en/reference/ingres-ii/functions/ingres-errsqlstate.xml
Mehdi Achour 9f68d649a7 WS, prepare for new doc style
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237358 c90b9560-bf6c-de11-be94-00142212c4b1
2007-06-10 19:06:37 +00:00

79 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/ingres_ii.xml, last change in rev 1.1 -->
<refentry id="function.ingres-errsqlstate">
<refnamediv>
<refname>ingres_errsqlstate</refname>
<refpurpose>Gets the last SQLSTATE error code generated</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>ingres_errsqlstate</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link</parameter></methodparam>
</methodsynopsis>
<para>
Returns a string containing the last SQLSTATE, or NULL if no error has
occurred.
</para>
<para>
If a <parameter>link</parameter> resource is passed to
<function>ingres_errsqlstate</function> it returns the last error
recorded for the link. If no link is passed then
<function>ingres_errsqlstate</function> returns the last error reported
using the default link.
</para>
<para>
The function, <function>ingres_errsqlstate</function>, should always be
called after executing any database query. Calling another function
before <function>ingres_errsqlstate</function> is called will reset or
change any error message from the last Ingres function call.
</para>
<para>
<example>
<title><function>ingres_errsqlstate</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
ingres_connect($database, $user, $password);
ingres_query("select * from table");
$error_sqlstate = ingres_errsqlstate();
if ( is_null($error_sqlstate) ) {
echo "An error occured - " . $error_sqlstate;
}
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<function>ingres_errno</function> and
<function>ingres_errsqlstate</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
-->