php-doc-en/reference/pdo/functions/PDOStatement-errorCode.xml
Dan Scott 47febed813 Continue the conversion to the new reference template.
Add another couple of constants, and update the PDOStatement
error functions to reflect the new reality.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@178485 c90b9560-bf6c-de11-be94-00142212c4b1
2005-01-29 04:28:40 +00:00

87 lines
2.2 KiB
XML

<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.3 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDOStatement-errorCode">
<refnamediv>
<refname>PDOStatement::errorCode</refname>
<refpurpose>
Fetch the SQLSTATE associated with the last operation on the statement handle
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>PDOStatement::errorCode</methodname>
<void/>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a SQLSTATE, a five-character alphanumeric identifier defined in the ANSI SQL
standard. <function>PDOStatement::errorCode</function> only retrieves error codes
for operations performed with PDOStatement objects.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example><title>Retrieving a SQLSTATE code</title>
<programlisting role="php">
<![CDATA[
<?php
/* Provoke an error -- the BONES table does not exist */
$err = $dbh->prepare('SELECT skull FROM bones');
$err->execute();
echo "\nPDOStatement::errorCode(): ";
print $err->errorCode();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
PDOStatement::errorCode(): 42S02
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>PDO::errorCode</function></member>
<member><function>PDO::errorInfo</function></member>
<member><function>PDOStatement::errorInfo</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
-->