From 739c68b9a41584499e191af3245f36f0c1e884bf Mon Sep 17 00:00:00 2001 From: Jeroen van Wolffelaar Date: Wed, 16 May 2001 15:25:31 +0000 Subject: [PATCH] - Fixed types - Removed outdated para - Added some return description, and comments where still undocumented git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@47586 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mysql.xml | 170 ++++++++++++++++++-------------------------- 1 file changed, 70 insertions(+), 100 deletions(-) diff --git a/functions/mysql.xml b/functions/mysql.xml index a85bcecfcc..12d2c4d5cd 100644 --- a/functions/mysql.xml +++ b/functions/mysql.xml @@ -38,7 +38,7 @@ int mysql_affected_rows - int + resource link_identifier @@ -107,7 +107,7 @@ database - int + resource link_identifier @@ -121,6 +121,9 @@ specified, this will default or current database after the user has been changed. If the new user and password authorization fails, the current connected user stays active. + + + This function was introduced in PHP 3.0.13 and requires MySQL 3.23.3 or higher. @@ -136,8 +139,8 @@ Description - int mysql_close - int + bool mysql_close + resource link_identifier @@ -155,7 +158,9 @@ Using mysql_close isn't usually necessary, as non-persistent open links are automatically closed at the end - of the script's execution. + of the script's execution. See also + freeing + resources. @@ -190,7 +195,7 @@ Description - int mysql_connect + resource mysql_connect string hostname @@ -212,8 +217,7 @@ - Returns a positive MySQL link identifier on success, or an error - message on failure. + Returns a MySQL link identifier on success, or FALSE on failure. mysql_connect establishes a connection @@ -283,7 +287,7 @@ int mysql_create_db string database name - int + resource link_identifier @@ -295,6 +299,7 @@ database on the server associated with the specified link identifier. + MySQL create database example @@ -328,8 +333,8 @@ Description - int mysql_data_seek - int result_identifier + bool mysql_data_seek + resource result_identifier int row_number @@ -364,14 +369,14 @@ for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) { if (!mysql_data_seek ($result, $i)) { - printf ("Cannot seek to row %d\n", $i); + echo "Cannot seek to row $i\n"; continue; } if(!($row = mysql_fetch_object ($result))) continue; - printf ("%s %s<BR>\n", $row->last_name, $row->first_name); + echo ("$row->last_name $row->first_name<BR>\n"; } mysql_free_result ($result); @@ -390,8 +395,8 @@ Description - int mysql_db_name - int result + string mysql_db_name + resource result int row mixed @@ -451,10 +456,10 @@ while ($i < $cnt) { Description - int mysql_db_query + resource mysql_db_query string database string query - int + resource link_identifier @@ -462,7 +467,7 @@ while ($i < $cnt) { - Returns: A positive MySQL result identifier to the query result, + Returns: A positive MySQL result resource to the query result, or false on error. @@ -474,8 +479,7 @@ while ($i < $cnt) { arguments - See also mysql_connect and - mysql_query. + See also mysql_connect. For downwards @@ -493,9 +497,9 @@ while ($i < $cnt) { Description - int mysql_drop_db + bool mysql_drop_db string database_name - int + resource link_identifier @@ -528,7 +532,7 @@ while ($i < $cnt) { int mysql_errno - int + resource link_identifier @@ -578,7 +582,7 @@ echo mysql_errno().": ".mysql_error()."<BR>"; string mysql_error - int + resource link_identifier @@ -628,7 +632,7 @@ echo mysql_errno().": ".mysql_error()."<BR>"; array mysql_fetch_array - int result + resource result int result_type @@ -703,7 +707,7 @@ mysql_free_result ($result); array mysql_fetch_assoc - int result + resource result @@ -762,7 +766,7 @@ mysql_free_result ($result); object mysql_fetch_field - int result + resource result int field_offset @@ -898,7 +902,7 @@ mysql_free_result ($result); array mysql_fetch_lengths - int result + resource result @@ -930,7 +934,7 @@ mysql_free_result ($result); object mysql_fetch_object - int result + resource result int result_type @@ -991,7 +995,7 @@ mysql_free_result ($result); array mysql_fetch_row - int result + resource result @@ -1031,7 +1035,7 @@ mysql_free_result ($result); string mysql_field_flags - int result + resource result int field_offset @@ -1065,7 +1069,7 @@ mysql_free_result ($result); string mysql_field_name - int result + resource result int field_index @@ -1128,7 +1132,7 @@ password int mysql_field_len - int result + resource result int field_offset @@ -1155,7 +1159,7 @@ password int mysql_field_seek - int result + resource result int field_offset @@ -1183,7 +1187,7 @@ password string mysql_field_table - int result + resource result int field_offset @@ -1210,7 +1214,7 @@ password string mysql_field_type - int result + iresource result int field_offset @@ -1266,7 +1270,7 @@ mysql_close(); int mysql_free_result - int result + resource result @@ -1278,7 +1282,9 @@ mysql_close(); you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution. + + For downward compatibility mysql_freeresult can also be used. @@ -1298,7 +1304,7 @@ mysql_close(); int mysql_insert_id - int + resource link_identifier @@ -1352,8 +1358,8 @@ mysql_close(); Description - int mysql_list_dbs - int + resource mysql_list_dbs + resource link_identifier @@ -1400,6 +1406,7 @@ database3 For downward compatibility mysql_listdbs can also be used. + See also mysql_db_name @@ -1412,10 +1419,10 @@ database3 Description - int mysql_list_fields + resource mysql_list_fields string database_name string table_name - int + resource link_identifier @@ -1431,13 +1438,15 @@ database3 mysql_field_name, and mysql_field_type. + <function>mysql_list_fields</function> example @@ -1468,6 +1477,10 @@ field3 For downward compatibility mysql_listfields can also be used. + @@ -1480,9 +1493,9 @@ field3 Description - int mysql_list_tables + resource mysql_list_tables string database - int + resource link_identifier @@ -1513,7 +1526,7 @@ field3 int mysql_num_fields - int result + resource result @@ -1543,7 +1556,7 @@ field3 int mysql_num_rows - int result + resource result @@ -1593,7 +1606,7 @@ echo "$num_rows Rows\n"; Description - int mysql_pconnect + resource mysql_pconnect string hostname @@ -1636,6 +1649,8 @@ echo "$num_rows Rows\n"; + + mysql_pconnect acts very much like mysql_connect with two major differences. @@ -1667,9 +1682,9 @@ echo "$num_rows Rows\n"; Description - int mysql_query + resource mysql_query string query - int + resource link_identifier @@ -1749,7 +1764,6 @@ $result = mysql_query ("SELECT my_col FROM my_tbl") See also: mysql_affected_rows, mysql_db_query, - mysql_unbuffered_query, mysql_free_result, mysql_result, mysql_select_db, and @@ -1758,50 +1772,6 @@ $result = mysql_query ("SELECT my_col FROM my_tbl") - - - mysql_unbuffered_query - Send an SQL query to MySQL, without fetching and buffering the result rows - - - Description - - - int mysql_unbuffered_query - string query - int - link_identifier - - int - result_mode - - - - - mysql_unbuffered_query sends a SQL query to MySQL, - without fetching and buffering the result rows automatically, as - mysql_query does. - On the one hand, this saves a considerable amount of memory with SQL - queries that produce large result sets. On the other hand, you can start - working on the result set immediately after the first row has been - retrieved: you don't have to wait until the complete SQL query has been - performed. - - - - The benefits of mysql_unbuffered_query come at a - cost: You cannot use mysql_num_rows on a result set - returned from mysql_unbuffered_query. You also have - to fetch all result rows from an unbuffered SQL query, before you can - send a new SQL query to MySQL. - - - - See also: mysql_query. - - - - mysql_result @@ -1812,7 +1782,7 @@ $result = mysql_query ("SELECT my_col FROM my_tbl") mixed mysql_result - int result + resource result int row mixed @@ -1860,9 +1830,9 @@ $result = mysql_query ("SELECT my_col FROM my_tbl") Description - int mysql_select_db + bool mysql_select_db string database_name - int + resource link_identifier @@ -1906,7 +1876,7 @@ $result = mysql_query ("SELECT my_col FROM my_tbl") string mysql_tablename - int result + resource result int i