From 39e039f00ccbd02b2ebd95dbbed2f289ca7e5f80 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Mon, 2 Dec 2002 02:37:29 +0000 Subject: [PATCH] Documentation Bug #20743. Added usage of mysql_error() to examples. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@106520 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysql/functions/mysql-affected-rows.xml | 6 +++--- reference/mysql/functions/mysql-close.xml | 4 ++-- reference/mysql/functions/mysql-create-db.xml | 6 +++--- reference/mysql/functions/mysql-data-seek.xml | 10 +++++----- reference/mysql/functions/mysql-fetch-array.xml | 8 ++++---- reference/mysql/functions/mysql-fetch-field.xml | 6 +++--- reference/mysql/functions/mysql-field-name.xml | 4 ++-- reference/mysql/functions/mysql-get-host-info.xml | 4 ++-- reference/mysql/functions/mysql-get-proto-info.xml | 4 ++-- reference/mysql/functions/mysql-get-server-info.xml | 4 ++-- reference/mysql/functions/mysql-insert-id.xml | 4 ++-- reference/mysql/functions/mysql-query.xml | 6 +++--- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/reference/mysql/functions/mysql-affected-rows.xml b/reference/mysql/functions/mysql-affected-rows.xml index 29d2cd1efa..2a413d6e0f 100644 --- a/reference/mysql/functions/mysql-affected-rows.xml +++ b/reference/mysql/functions/mysql-affected-rows.xml @@ -1,5 +1,5 @@ - + @@ -58,7 +58,7 @@ - + @@ -41,7 +41,7 @@ diff --git a/reference/mysql/functions/mysql-create-db.xml b/reference/mysql/functions/mysql-create-db.xml index 83a0fb5d8d..10436a5298 100644 --- a/reference/mysql/functions/mysql-create-db.xml +++ b/reference/mysql/functions/mysql-create-db.xml @@ -1,5 +1,5 @@ - + @@ -29,12 +29,12 @@ ]]> diff --git a/reference/mysql/functions/mysql-data-seek.xml b/reference/mysql/functions/mysql-data-seek.xml index 940d6d4b9c..53fbee450c 100644 --- a/reference/mysql/functions/mysql-data-seek.xml +++ b/reference/mysql/functions/mysql-data-seek.xml @@ -1,5 +1,5 @@ - + @@ -40,19 +40,19 @@ = 0; $i--) { if (!mysql_data_seek($result, $i)) { - echo "Cannot seek to row $i\n"; + echo "Cannot seek to row $i: " . mysql_error() . "\n"; continue; } diff --git a/reference/mysql/functions/mysql-fetch-array.xml b/reference/mysql/functions/mysql-fetch-array.xml index 6156dc78f7..aa2c41a63a 100644 --- a/reference/mysql/functions/mysql-fetch-array.xml +++ b/reference/mysql/functions/mysql-fetch-array.xml @@ -1,5 +1,5 @@ - + @@ -69,7 +69,7 @@ select table1.field as foo table2.field as bar from table1, table2 - + @@ -97,10 +97,10 @@ - + @@ -42,7 +42,7 @@ */ $link = mysql_connect('localhost', "mysql_user", "mysql_password"); mysql_select_db($dbname, $link) - or die("Could not set $dbname"); + or die("Could not set $dbname: " . mysql_error()); $res = mysql_query("select * from users", $link); echo mysql_field_name($res, 0) . "\n"; diff --git a/reference/mysql/functions/mysql-get-host-info.xml b/reference/mysql/functions/mysql-get-host-info.xml index c5c4a66d3c..ade0304ef2 100644 --- a/reference/mysql/functions/mysql-get-host-info.xml +++ b/reference/mysql/functions/mysql-get-host-info.xml @@ -1,5 +1,5 @@ - + @@ -25,7 +25,7 @@ ]]> diff --git a/reference/mysql/functions/mysql-get-proto-info.xml b/reference/mysql/functions/mysql-get-proto-info.xml index 529a83dd31..370d3f91e8 100644 --- a/reference/mysql/functions/mysql-get-proto-info.xml +++ b/reference/mysql/functions/mysql-get-proto-info.xml @@ -1,5 +1,5 @@ - + @@ -25,7 +25,7 @@ ]]> diff --git a/reference/mysql/functions/mysql-get-server-info.xml b/reference/mysql/functions/mysql-get-server-info.xml index 1d80b9f67c..5b6ed19427 100644 --- a/reference/mysql/functions/mysql-get-server-info.xml +++ b/reference/mysql/functions/mysql-get-server-info.xml @@ -1,5 +1,5 @@ - + @@ -25,7 +25,7 @@ ]]> diff --git a/reference/mysql/functions/mysql-insert-id.xml b/reference/mysql/functions/mysql-insert-id.xml index 22df3993ac..c846b7201c 100644 --- a/reference/mysql/functions/mysql-insert-id.xml +++ b/reference/mysql/functions/mysql-insert-id.xml @@ -1,5 +1,5 @@ - + @@ -56,7 +56,7 @@ - + @@ -56,7 +56,7 @@ ]]> @@ -73,7 +73,7 @@ $result = mysql_query("SELECT * WHERE 1=1") ]]>