diff --git a/reference/mysql/functions/mysql-errno.xml b/reference/mysql/functions/mysql-errno.xml index ed4507958b..79cfae6bf8 100644 --- a/reference/mysql/functions/mysql-errno.xml +++ b/reference/mysql/functions/mysql-errno.xml @@ -1,5 +1,5 @@ - + @@ -28,22 +28,35 @@ error code from the most recently executed MySQL function (not including mysql_error and mysql_errno), so if you want to use it, - make sure you check the value before calling another mySQL + make sure you check the value before calling another MySQL function. - + + mysql_errno Example "; + mysql_connect("localhost", "mysql_user", "mysql_password"); + mysql_select_db("nonexistentdb"); - echo mysql_errno().": ".mysql_error()."
"; - $conn = mysql_query("SELECT * FROM nonexistenttable"); - echo mysql_errno().": ".mysql_error()."
"; + echo mysql_errno() . ": " . mysql_error(). "\n"; + + mysql_select_db("kossu"); + mysql_query("SELECT * FROM nonexistenttable"); + echo mysql_errno() . ": " . mysql_error() . "\n"; ?> ]]>
-
+ + The above example would produce the following output: + + + + + See also: mysql_error diff --git a/reference/mysql/functions/mysql-error.xml b/reference/mysql/functions/mysql-error.xml index c6ee9b1c78..62e1311bdd 100644 --- a/reference/mysql/functions/mysql-error.xml +++ b/reference/mysql/functions/mysql-error.xml @@ -1,5 +1,5 @@ - + @@ -29,20 +29,33 @@ including mysql_error and mysql_errno), so if you want to use it, make sure you check the value before calling another MySQL function. - + + mysql_errno Example "; + mysql_connect("localhost", "mysql_user", "mysql_password"); + mysql_select_db("nonexistentdb"); - echo mysql_errno().": ".mysql_error()."
"; - $conn = mysql_query("SELECT * FROM nonexistenttable"); - echo mysql_errno().": ".mysql_error()."
"; + echo mysql_errno() . ": " . mysql_error(). "\n"; + + mysql_select_db("kossu"); + mysql_query("SELECT * FROM nonexistenttable"); + echo mysql_errno() . ": " . mysql_error() . "\n"; ?> ]]>
-
+ + The above example would produce the following output: + + + + +
See also: mysql_errno