Home  |  Linux  | Mysql  | PHP  | XML
From:Kalle Sommer Nielsen Date:Tue Aug 19 20:19:52 2008
Subject:cvs: phpdoc /en/reference/mysqli/mysqli connect.xml
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


Navigate in group php.doc.cvs at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants