vrana           Fri Feb 13 11:16:59 2004 EDT

  Modified files:              
    /phpdoc/en/reference/mysql/functions        mysql-errno.xml 
  Log:
  Updated example
  
http://cvs.php.net/diff.php/phpdoc/en/reference/mysql/functions/mysql-errno.xml?r1=1.8&r2=1.9&ty=u
Index: phpdoc/en/reference/mysql/functions/mysql-errno.xml
diff -u phpdoc/en/reference/mysql/functions/mysql-errno.xml:1.8 
phpdoc/en/reference/mysql/functions/mysql-errno.xml:1.9
--- phpdoc/en/reference/mysql/functions/mysql-errno.xml:1.8     Mon Jan  5 08:03:26 
2004
+++ phpdoc/en/reference/mysql/functions/mysql-errno.xml Fri Feb 13 11:16:58 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
 <!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
   <refentry id="function.mysql-errno">
    <refnamediv>
@@ -37,12 +37,14 @@
 <?php
 $link = mysql_connect("localhost", "mysql_user", "mysql_password");
 
-mysql_select_db("nonexistentdb", $link);
-echo mysql_errno($link) . ": " . mysql_error($link). "\n";
+if (!mysql_select_db("nonexistentdb", $link)) {
+    echo mysql_errno($link) . ": " . mysql_error($link). "\n";
+}
 
 mysql_select_db("kossu", $link);
-mysql_query("SELECT * FROM nonexistenttable", $link);
-echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
+if (!mysql_query("SELECT * FROM nonexistenttable", $link)) {
+    echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
+}
 ?>
 ]]>
       </programlisting>

Reply via email to