From 133c59662b327a9153f9f2e00f79377d0fc2ff01 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 13 Feb 2002 22:13:26 +0000 Subject: [PATCH] a) inserted mysql_free_result in example b) changed mysql_query description: mysql_query returns a resultset for SELECT, EXPLAIN DESCRIBE and SHOW statements, not only for select statements. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@70196 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mysql.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/functions/mysql.xml b/functions/mysql.xml index af417cb737..729ef09c52 100644 --- a/functions/mysql.xml +++ b/functions/mysql.xml @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -111,6 +111,9 @@ while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { } print "\n"; +// Free resultset +mysql_free_result($result); + // Closing connection mysql_close($link); ?> @@ -1793,7 +1796,8 @@ echo "$num_rows Rows\n"; - Only for SELECT statements mysql_query + Only for SELECT,SHOW,EXPLAIN or DESCRIBE statements + mysql_query returns a resource identifier or &false; if the query was not executed correctly. For other type of SQL statements, mysql_query returns &true; on success @@ -1849,7 +1853,8 @@ $result = mysql_query("SELECT my_col FROM my_tbl") statement. - Only for SELECT statements, mysql_query + Only for SELECT,SHOW,DESCRIBE or EXPLAIN statements, + mysql_query returns a new result identifier that you can pass to mysql_fetch_array and other functions dealing with result tables. When you are done with the