php-doc-en/reference/maxdb/functions/maxdb-connect-error.xml
Thomas Simenec 2ec5f57850 update docu
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184408 c90b9560-bf6c-de11-be94-00142212c4b1
2005-04-15 17:53:21 +00:00

89 lines
2.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.maxdb-connect-error">
<refnamediv>
<refname>maxdb_connect_error</refname>
<refpurpose>Returns a string description of the last connect error</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>maxdb_connect_error</methodname>
<void />
</methodsynopsis>
<para>
The <function>maxdb_connect_error</function> function is identical to the corresponding
<function>maxdb_connect_errno</function> function in every way, except instead of returning
an integer error code the <function>maxdb_connect_error</function> function will return
a string representation of the last error to occur for the last
<function>maxdb_connect</function> call.
If no error has occured, this function will return an empty string.
</para>
</refsect1>
<refsect1>
<title>Return values</title>
<para>
A string that describes the error. An empty string if no error occurred.
</para>
</refsect1>
<refsect1>
<title>See also</title>
<para>
<function>maxdb_connect</function>,
<function>maxdb_connect_errno</function>,
<function>maxdb_errno</function>,
<function>maxdb_error</function>,
<function>maxdb_sqlstate</function>
</para>
</refsect1>
<refsect1>
<title>Example</title>
<para>
<example>
<title>maxdb_connect_error sample</title>
<programlisting role="php">
<![CDATA[
<?php
$link = maxdb_connect("localhost", "nonexisting_user", "");
if (!$link) {
printf("Can't connect to localhost. Error: %s\n", maxdb_connect_error());
}
?>
]]>
</programlisting>
</example>
</para>
<para>
The above example would produce the following output:
</para>
<screen>
<![CDATA[
PHP Warning: maxdb_connect(): -4008 POS(1) Unknown user name/password combination <...>
Can't connect to localhost. Error: POS(1) Unknown user name/password combination
]]>
</screen>
</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
-->