georg           Sun Apr 21 09:47:45 2002 EDT

  Modified files:              
    /phpdoc/en/reference/mysql/functions        mysql-error.xml 
  Log:
  changed/corrected example
  
  
Index: phpdoc/en/reference/mysql/functions/mysql-error.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-error.xml:1.2 
phpdoc/en/reference/mysql/functions/mysql-error.xml:1.3
--- phpdoc/en/reference/mysql/functions/mysql-error.xml:1.2     Wed Apr 17 02:41:08 
2002
+++ phpdoc/en/reference/mysql/functions/mysql-error.xml Sun Apr 21 09:47:45 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
   <refentry id="function.mysql-error">
    <refnamediv>
@@ -29,20 +29,33 @@
      including <function>mysql_error</function> and
      <function>mysql_errno</function>), so if you want to use it, make
      sure you check the value before calling another MySQL function.
-     <informalexample>
+     <example>
+      <title>mysql_errno Example</title>
       <programlisting role="php">
 <![CDATA[
 <?php
-    mysql_connect("marliesle");
-    echo mysql_errno().": ".mysql_error()."<br />";
+    mysql_connect("localhost", "mysql_user", "mysql_password");
+
     mysql_select_db("nonexistentdb");
-    echo mysql_errno().": ".mysql_error()."<br />";
-    $conn = mysql_query("SELECT * FROM nonexistenttable");
-    echo mysql_errno().": ".mysql_error()."<br />";
+    echo mysql_errno() . ": " . mysql_error(). "\n";
+
+    mysql_select_db("kossu");
+    mysql_query("SELECT * FROM nonexistenttable");
+    echo mysql_errno() . ": " . mysql_error() . "\n";
 ?>
 ]]>
       </programlisting>
-     </informalexample>
+      <para>
+       The above example would produce the following output:
+      </para>
+       <screen>
+<![CDATA[
+1049: Unknown database 'nonexistentdb'
+1146: Table 'kossu.nonexistenttable' doesn't exist
+Records deleted: 0
+]]>
+       </screen>
+     </example>
     </para>
     <para>
      See also: <function>mysql_errno</function>


Reply via email to