cvs: phpdoc /en/reference/mysqli/mysqli connect.xml

From: Date: Wed, 20 Aug 2008 02:19:52 +0000
Subject: cvs: phpdoc /en/reference/mysqli/mysqli connect.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2060@lists.php.net to get a copy of this message
kalle Wed Aug 20 02:19:52 2008 UTC Modified files: /phpdoc/en/reference/mysqli/mysqli connect.xml Log: * Fixes #45646 (Failed Connect Does Not Return FALSE) * Add a notice about dealing with connection error handling http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mysqli/mysqli/connect.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/mysqli/mysqli/connect.xml diff -u phpdoc/en/reference/mysqli/mysqli/connect.xml:1.2 phpdoc/en/reference/mysqli/mysqli/connect.xml:1.3 --- phpdoc/en/reference/mysqli/mysqli/connect.xml:1.2 Wed Jan 2 15:48:24 2008 +++ phpdoc/en/reference/mysqli/mysqli/connect.xml Wed Aug 20 02:19:52 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="mysqli.connect" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysqli::__construct</refname> @@ -109,8 +109,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns a object which represents the connection to a MySQL Server or - &false; if the connection failed. + Returns a object which represents the connection to a MySQL Server. </para> </refsect1> @@ -124,7 +123,7 @@ $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ -if (mysqli_connect_errno()) { +if ($mysqli->connect_error) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } @@ -170,6 +169,14 @@ &reftitle.notes; <note> <para> + OO syntax only: If a connection fails an object is still returned. To check + if the connection failed then use the <link + linkend="mysqli.connect-error">mysqli->connect_error</link> property like in + the examples above. + </para> + </note> + <note> + <para> Error "Can't create TCP/IP socket (10106)" usually means that the <link linkend="ini.variables-order">variables_order</link> configure directive doesn't contain character <literal>E</literal>. On Windows, if the

« previous php.doc.cvs (#2060) next »