mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 10:28:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@200473 c90b9560-bf6c-de11-be94-00142212c4b1
86 lines
2.2 KiB
XML
86 lines
2.2 KiB
XML
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- 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>string</type><methodname>PDOStatement::errorCode</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Identical to <function>PDO::errorCode</function>, except that
|
|
<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
|
|
-->
|