2004-11-10 22:21:24 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2005-01-29 04:28:40 +00:00
|
|
|
<!-- $Revision: 1.3 $ -->
|
2004-11-10 22:21:24 +00:00
|
|
|
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
|
|
|
<refentry id="function.PDOStatement-errorCode">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>PDOStatement::errorCode</refname>
|
|
|
|
<refpurpose>
|
2005-01-29 04:28:40 +00:00
|
|
|
Fetch the SQLSTATE associated with the last operation on the statement handle
|
2004-11-10 22:21:24 +00:00
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
2005-01-29 04:28:40 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2004-11-10 22:21:24 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>PDOStatement::errorCode</methodname>
|
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
2004-11-26 03:15:40 +00:00
|
|
|
&warn.experimental.func;
|
2005-01-29 04:28:40 +00:00
|
|
|
</refsect1>
|
2004-11-10 22:21:24 +00:00
|
|
|
|
2005-01-29 04:28:40 +00:00
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2004-11-26 03:15:40 +00:00
|
|
|
<para>
|
2005-01-29 04:28:40 +00:00
|
|
|
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.
|
2004-11-26 03:15:40 +00:00
|
|
|
</para>
|
2005-01-29 04:28:40 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example><title>Retrieving a SQLSTATE code</title>
|
|
|
|
<programlisting role="php">
|
2004-11-26 03:15:40 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
/* Provoke an error -- the BONES table does not exist */
|
|
|
|
$err = $dbh->prepare('SELECT skull FROM bones');
|
|
|
|
$err->execute();
|
2004-11-10 22:21:24 +00:00
|
|
|
|
2004-11-26 03:15:40 +00:00
|
|
|
echo "\nPDOStatement::errorCode(): ";
|
2005-01-29 04:28:40 +00:00
|
|
|
print $err->errorCode();
|
2004-11-26 03:15:40 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2005-01-29 04:28:40 +00:00
|
|
|
</programlisting>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
2004-11-26 03:15:40 +00:00
|
|
|
<![CDATA[
|
2005-01-29 04:28:40 +00:00
|
|
|
PDOStatement::errorCode(): 42S02
|
2004-11-26 03:15:40 +00:00
|
|
|
]]>
|
2005-01-29 04:28:40 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</refsect1>
|
2005-01-29 04:28:40 +00:00
|
|
|
|
|
|
|
<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>
|
|
|
|
|
2004-11-10 22:21:24 +00:00
|
|
|
</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
|
|
|
|
-->
|