[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
slawek Sat Apr 13 16:37:57 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Example password correction Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.108 phpdoc/en/functions/mysql.xml:1.109 --- phpdoc/en/functions/mysql.xml:1.108 Thu Apr 11 13:26:29 2002 +++ phpdoc/en/functions/mysql.xml Sat Apr 13 16:37:57 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -436,7 +436,7 @@
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
slawek Thu Apr 11 13:26:32 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Little WS and example corrections. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.107 phpdoc/en/functions/mysql.xml:1.108 --- phpdoc/en/functions/mysql.xml:1.107 Thu Apr 11 11:23:48 2002 +++ phpdoc/en/functions/mysql.xml Thu Apr 11 13:26:29 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1344,7 +1344,7 @@ their offsets (numbers are illegal property names). - + - + Speed-wise, the function is identical to @@ -2554,7 +2554,7 @@ The above example would produce the following output: @@ -2660,7 +2660,7 @@ - + mysql_stat Get current system status
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Thu Apr 11 11:23:50 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: changed samples (consistent parameters) Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.106 phpdoc/en/functions/mysql.xml:1.107 --- phpdoc/en/functions/mysql.xml:1.106 Wed Apr 10 12:22:29 2002 +++ phpdoc/en/functions/mysql.xml Thu Apr 11 11:23:48 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -287,7 +287,7 @@
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
Sander Roobol wrote: > sanderWed Apr 10 11:24:56 2002 EDT > > Modified files: > /phpdoc/en/functions mysql.xml > Log: > Added note that mysql_real_esacpe_string() is only available in 4.3.0 > version information has been updated today, so this is redundant ... -- Hartmut Holzgraefe [EMAIL PROTECTED] http://www.six.de/ +49-711-99091-77
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
sander Wed Apr 10 12:22:30 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Removing note again... Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.105 phpdoc/en/functions/mysql.xml:1.106 --- phpdoc/en/functions/mysql.xml:1.105 Wed Apr 10 11:24:54 2002 +++ phpdoc/en/functions/mysql.xml Wed Apr 10 12:22:29 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -993,11 +993,6 @@ - - - mysql_real_escape_string was added in PHP 4.3.0. - - See also: mysql_real_escape_string
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
sander Wed Apr 10 11:24:56 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Added note that mysql_real_esacpe_string() is only available in 4.3.0 Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.104 phpdoc/en/functions/mysql.xml:1.105 --- phpdoc/en/functions/mysql.xml:1.104 Fri Mar 29 18:26:31 2002 +++ phpdoc/en/functions/mysql.xml Wed Apr 10 11:24:54 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -993,6 +993,11 @@ + + + mysql_real_escape_string was added in PHP 4.3.0. + + See also: mysql_real_escape_string
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
betzFri Mar 29 18:26:31 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: added ini-settings from config.xml to Runtime Config Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.103 phpdoc/en/functions/mysql.xml:1.104 --- phpdoc/en/functions/mysql.xml:1.103 Fri Mar 29 10:26:33 2002 +++ phpdoc/en/functions/mysql.xml Fri Mar 29 18:26:31 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -44,9 +44,9 @@ Runtime Configuration The behaviour of the MySQL functions is affected by settings in the - global configuration file. + global configuration file &php.ini;. - MySQL Configuration Options + MySQL Configuration Options @@ -96,12 +96,131 @@ NULL PHP_INI_ALL - For further details and definition of the PHP_INI_* constants see ini_set. + + +Here is a short explanation of the configuration directives. + + + + + mysql.allow_persistent + boolean + + + +Wether to allow +persistent connections +to MySQL. + + + + + + + mysql.max_persistent + integer + + + +The maximum number of persistent MySQL connections per +process. + + + + + + + mysql.max_links + integer + + + +The maximum number of MySQL connections per process, including +persistent connections. + + + + + + + mysql.default_port + string + + + +The default TCP port number to use when connecting to +the database server if no other port is specified. If +no default is specified, the port will be obtained +from the MYSQL_TCP_PORT environment +variable, the mysql-tcp entry in +/etc/services or the compile-time +MYSQL_PORT constant, in that order. Win32 +will only use the MYSQL_PORT constant. + + + + + + + mysql.default_socket + string + + + +The default socket name to use when connecting to a local +database server if no other socket name is specified. + + + + + + + mysql.default_host + string + + + +The default server host to use when connecting to the database +server if no other host is specified. Doesn't apply in +safe mode. + + + + + + + mysql.default_user + string + + + +The default user name to use when connecting to the database +server if no other name is specified. Doesn't apply in +safe mode. + + + + + + + mysql.default_password + string + + + +The default password to use when connecting to the database +server if no other password is specified. Doesn't apply in +safe mode. + + + + +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
betzFri Mar 29 10:26:33 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: one missing runtime config added Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.102 phpdoc/en/functions/mysql.xml:1.103 --- phpdoc/en/functions/mysql.xml:1.102 Fri Mar 29 07:47:31 2002 +++ phpdoc/en/functions/mysql.xml Fri Mar 29 10:26:33 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -91,6 +91,12 @@ NULL PHP_INI_ALL + + mysql.default_password + NULL + PHP_INI_ALL + +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jan Fri Mar 29 07:47:31 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: - documenting mysql_info Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.101 phpdoc/en/functions/mysql.xml:1.102 --- phpdoc/en/functions/mysql.xml:1.101 Mon Mar 25 15:26:03 2002 +++ phpdoc/en/functions/mysql.xml Fri Mar 29 07:47:31 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1558,6 +1558,61 @@ For downward compatibility mysql_freeresult can also be used. This is deprecated, however. + + + + + +mysql_info + + Get information about the most recent query + + + +Description + + stringmysql_info + resource +link_identifier + + + + mysql_info returns detailed information about + the last query using the given link_identifier. + If link_identifier isn't specified, the last + opened link is assumed. + + + mysql_info returns a string for all statements + listed below. For all other &false;. The string format depends on the + given statement. + + Relevant MySQL Statements + + + + + The numbers are only for illustrating purpose; their values will + correspond to the query. + + + + mysql_info returns a non-&false; value for the + INSERT ... VALUES statement only if multiple value lists are + specified in the statement. + +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml uodbc.xml
derick Mon Mar 25 15:26:03 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml uodbc.xml Log: - Fix examples in MySQL - Fix parameters types and reorder sections in uodbc Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.100 phpdoc/en/functions/mysql.xml:1.101 --- phpdoc/en/functions/mysql.xml:1.100 Mon Mar 25 07:22:22 2002 +++ phpdoc/en/functions/mysql.xml Mon Mar 25 15:26:03 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -159,38 +159,36 @@ MySQL extension overview example - + @@ -316,7 +314,7 @@ $link = mysql_connect('localhost', 'myname', 'secret'); $charset = mysql_character_set_name($link); printf ("current character set is %s\n", $charset); - +?> ]]> @@ -510,6 +508,7 @@ =0; $i--) { +/* fetch rows in reverse order */ +for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row $i\n"; continue; @@ -623,17 +621,17 @@ @@ -753,12 +751,12 @@ @@ -802,12 +800,12 @@ @@ -852,21 +850,21 @@ mysql_real_escape_string example - + The above example would produce the following output: - + @@ -948,16 +946,16 @@ @@ -1015,15 +1013,15 @@ @@ -1131,7 +1129,7 @@ mysql_select_db("database"); $result = mysql_query("select * from table") or die("Query failed"); -# get column metadata +/* get column metadata */ $i = 0; while ($i < mysql_num_fields($result)) { echo "Information for column $i:\n"; @@ -1139,7 +1137,7 @@ if (!$meta) { echo "No information available\n"; } -echo " +echo " blob: $meta->blob max_length: $meta->max_length multiple_key: $meta->multiple_key @@ -1152,7 +1150,7 @@ unique_key: $meta->unique_key unsigned: $meta->unsigned zerofill: $meta->zerofill -"; +"; $i++; } mysql_free_result($result); @@ -1225,9 +1223,9 @@ @@ -1775,7 +1773,7 @@ $row["Command"], $row["Time"]); } mysql_free_result ($result); - +?> ]]> @@ -2078,7 +2076,7 @@ @@ -2199,17 +2197,17 @@ The above example would produce the following output: @@ -2332,10 +2330,10 @@ @@ -2367,8 +2365,9 @@ $link = mysql_connect('localhost', 'myname', 'secret'); $thread_id = mysql_thread_id($link); if ($thread_id){ - printf ("current thread id is %d\n", $thread_id); +printf ("current thread id is %d\n", $thread_id); } +?> ]]> @@ -2508,8 +2507,10 @@ mysql_stat example Index: phpdoc/en/functions/uodbc.xml diff -u phpdoc/en/functions/uodbc.xml:1.33 phpdoc/en/functions/uodbc.xml:1.34 --- phpdoc/en/functions/uodbc.xml:1.33 Mon Mar 11 20:13:36 2002 +++ phpdoc/en/functions/uodbc.xml Mon Mar 25 15:26:03 2002 @@ -1,35 +1,19 @@ - + Unified ODBC functions ODBC - + In addition to normal ODBC support, the Unified ODBC functions in PHP allow you to access several databases that have borrowed the semantics of the ODBC API to implement their own API. Instead of maintaining multiple database drivers that were all nearly identical, these drivers have been unified into a single set of ODBC functions. - - -The following databases are supported by the Unified ODBC -functions: Adabas D, IBM DB2, iODBC, Solid, and Sybase SQL Anywhere. - - + - + There is no ODBC involved when connecting to the above databases. The functions that you use to speak natively to them just happen to share the same names and syntax as the ODBC @@ -38,8 +22,49 @@ applications. iODBC is maintained by OpenLink Software. More information on iODBC, as well as a HOWTO, is available at www.iodbc.org. - + + + + + The following databases are supported by the Unified ODBC + functions: Adabas D, IBM DB2, iODBC, Solid, and Sybase SQL Anywhere. + + + + + + Please see the Installation on Unix + Systems chapter for more information about configuring PHP + with these databases. + + + + +Runtime Configuration + + This extension does not define any configuration directives. + + + + +Resource types + + This extension does not define any resource types. + + + + +Predefined constants + + This extension does not define any constants. + + @@ -50,9 +75,9 @@ Description - intodbc_autocommit - intconnection_id - intOnOff + boolodbc_autocommit + +resourceconnection_id + boolOnOff Without the OnOff parameter, this function @@ -87,7 +112,7 @@ Descrip
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Mon Mar 25 07:22:22 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: changed typos (omited -> omitted) changed description for mysql_escape_string documentation for new functions: - mysql_character_set_name - mysql_ping - mysql_real_escape_string - mysql_thread_id Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.99 phpdoc/en/functions/mysql.xml:1.100 --- phpdoc/en/functions/mysql.xml:1.99 Sun Mar 24 18:48:15 2002 +++ phpdoc/en/functions/mysql.xml Mon Mar 25 07:22:22 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -293,6 +293,48 @@ + + +mysql_character_set_name +Returns the name of the character set + + +Description + + intmysql_character_set_name + resourcelink_identifier + + + mysql_character_set_name returns the default + character set name for the current connection. + + + mysql_character_set_name example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_real_escape_string + + + + mysql_close @@ -786,10 +828,10 @@ Description - - stringmysql_escape_string - stringunescaped_string - + + stringmysql_escape_string + +stringunescaped_string + This function will escape the unescaped_string, so that it is safe to place it in a mysql_query. @@ -799,7 +841,39 @@ mysql_escape_string does not escape % and _. + + This function is identical to mysql_real_escape_string +except that + mysql_real_escape_string() takes a connection handler and escapes the + string according to the current character + set. mysql_escape_string does not take a + connection argument and does not respect the current charset setting. + + + mysql_real_escape_string example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_real_escape_string + @@ -1715,6 +1789,10 @@ + + See also: + mysql_thread_id + @@ -1906,6 +1984,36 @@ + + +mysql_ping +Ping a server connection or reconnect if there is no +connection + + +Description + + boolmysql_ping + resource + link_identifier + + + + mysql_ping checks whether or not the connection to + the server is working. If it has gone down, an automatic reconnection is + attempted. This function can be used by scripts that remain idle for a + long while, to check whether or not the server has closed the connection + and reconnect if necessary. + mysql_ping returns &true; if the connection to the + server is working, otherwise &false;. + + + See also: + mysql_thread_id + mysql_list_processes + + + + mysql_query @@ -2059,6 +2167,61 @@ + + +mysql_real_escape_string + + Escapes special characters in a string for use in a SQL statement, taking into +account the current charset of the connection. + + + +Description + + stringmysql_real_escape_string + +stringunescaped_string + resourcelink_identifier + + + This function will escape special characters in the + unescaped_string, taking into account the current + charset of the connection so that it is safe to place it in a + mysql_query. + + + + mysql_real_escape_string does not escape + % and _. + + + + mysql_real_escape_string example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_escape_string + mysql_character_set_name + + + + mysql_result @@ -2182,6 +2345,49 @@ + + +mysql_thread_id +Return the current thread id + + +Description + + intmysql_thread_id + resourcelink_identifier + + + mysql_thread_id returns the current thread id. If the +connection is lost and you reconnect with mysql_ping, the thread +ID will change. This means you should not get the thread ID and store it for later. +You should get it when you need it. + + + mysql_list_processes example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_ping + mysql_list_processes + + + + mysql_get_client_info @@ -2218,7 +2424,7 @@ mysql_get_host_info returns a string describing the type of connection in use for the connection link_identifi
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
manuzhaiSun Mar 24 18:48:15 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Yet another typo. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.98 phpdoc/en/functions/mysql.xml:1.99 --- phpdoc/en/functions/mysql.xml:1.98 Sun Mar 24 18:43:40 2002 +++ phpdoc/en/functions/mysql.xml Sun Mar 24 18:48:15 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -2294,7 +2294,7 @@ mysql_stat currently only returns status for uptime, threads, queries, open tables, flush tables and queries per second. For a complete list of other status variables you have to use the SHOW STATUS - sql command. + SQL command.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
manuzhaiSun Mar 24 18:43:40 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Fixed typo Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.97 phpdoc/en/functions/mysql.xml:1.98 --- phpdoc/en/functions/mysql.xml:1.97 Sun Mar 24 06:15:22 2002 +++ phpdoc/en/functions/mysql.xml Sun Mar 24 18:43:40 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -2242,7 +2242,7 @@ mysql_get_proto_info returns the protocol version used by connection link_identifier. If - link_identifier is omited, the last opened + link_identifier is omitted, the last opened connection will be used.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Sun Mar 24 06:15:23 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: fixed typo Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.96 phpdoc/en/functions/mysql.xml:1.97 --- phpdoc/en/functions/mysql.xml:1.96 Sun Mar 24 05:53:30 2002 +++ phpdoc/en/functions/mysql.xml Sun Mar 24 06:15:22 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -2292,7 +2292,7 @@ mysql_stat currently only returns status for uptime, - threads, queries, open tables, flush tables and queris per second. For a + threads, queries, open tables, flush tables and queries per second. For a complete list of other status variables you have to use the SHOW STATUS sql command.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Sun Mar 24 05:53:31 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: documentation for new functions: mysql_stat and mysql_list_processes Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.95 phpdoc/en/functions/mysql.xml:1.96 --- phpdoc/en/functions/mysql.xml:1.95 Sat Mar 23 08:53:32 2002 +++ phpdoc/en/functions/mysql.xml Sun Mar 24 05:53:30 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1670,6 +1670,54 @@ + + +mysql_list_processes +List MySQL processes + + +Description + + resourcemysql_list_processes + resource +link_identifier + + + + mysql_list_processes returns a result pointer + describing the current server threads. + + + + mysql_list_processes example + + + + + The above example would produce the following output: + + + + + + + + + mysql_list_tables @@ -2223,6 +2271,51 @@ mysql_get_server_info was added in PHP 4.0.5. + + + + + + +mysql_stat +Get current system status + + +Description + + stringmysql_stat + resourcelink_identifier + + + mysql_stat returns the current server status. + + + + mysql_stat currently only returns status for uptime, + threads, queries, open tables, flush tables and queris per second. For a + complete list of other status variables you have to use the SHOW STATUS + sql command. + + + + + mysql_stat example + + + + + The above example would produce the following output: + + + + +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
cortesi Sat Mar 23 08:53:32 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: closing opened tag Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.94 phpdoc/en/functions/mysql.xml:1.95 --- phpdoc/en/functions/mysql.xml:1.94 Sat Mar 23 02:19:38 2002 +++ phpdoc/en/functions/mysql.xml Sat Mar 23 08:53:32 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -2211,7 +2211,7 @@ Description - stringmysql_get_server_info + stringmysql_get_server_info resourcelink_identifier
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
On March 22, 2002 00:27, Andrew Lindeman wrote: > What do we do? > > On Thursday 21 March 2002 12:33 pm, Gabor Hojtsy wrote: > > > > cnewbill Wed Mar 20 17:21:29 2002 EDT > > > > > > > > Modified files: > > > > /phpdoc/en/functions mysql.xml > > > > Log: > > > > See Bug #16187 The second parameter can't be used cause a number > > > > cannot > > > > > > be used as an object property. ie row->0 is invalid while row->field > > > > is, > > > > > > so MYSQL_NUM and MYSQL_BOTH don't matter it should always be > > > > MYSQL_ASSOC. > > > > > Hold On!!! Look in the source!? The second param exists! That's why > > > I asked which was wrong?! > > > > The other point is that number object properties could exist. > > > > var_dump((object) array(1, 2, 3, 4)); > > > > hm... > > > > The same for > > > > var_dump((object) array("+=|__-=.:'[]" => 4)); But this is valid (if somewhat nasty): $foo = 0; $obj->$foo = 10; echo $obj->$foo; --zak
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Sat Mar 23 02:19:38 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: changed return value from mysql_get_server_info, typo fixed Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.93 phpdoc/en/functions/mysql.xml:1.94 --- phpdoc/en/functions/mysql.xml:1.93 Wed Mar 20 17:21:29 2002 +++ phpdoc/en/functions/mysql.xml Sat Mar 23 02:19:38 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -2211,14 +2211,14 @@ Description - intmysql_get_server_info + stringmysql_get_server_info resourcelink_identifier mysql_get_server_info returns the server version used by connection link_identifier. If - link_identifier is omited, the last opened + link_identifier is omitted, the last opened connection will be used.
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
What do we do? On Thursday 21 March 2002 12:33 pm, Gabor Hojtsy wrote: > > > cnewbill Wed Mar 20 17:21:29 2002 EDT > > > > > > Modified files: > > > /phpdoc/en/functions mysql.xml > > > Log: > > > See Bug #16187 The second parameter can't be used cause a number > > cannot > > > > be used as an object property. ie row->0 is invalid while row->field > > is, > > > > so MYSQL_NUM and MYSQL_BOTH don't matter it should always be > > MYSQL_ASSOC. > > > Hold On!!! Look in the source!? The second param exists! That's why I > > asked which was wrong?! > > The other point is that number object properties could exist. > > var_dump((object) array(1, 2, 3, 4)); > > hm... > > The same for > > var_dump((object) array("+=|__-=.:'[]" => 4)); > > Goba -- The speed with which components become obsolete is directly proportional to the price of the component. -- Murphy's Computer Laws n°9
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
> > cnewbill Wed Mar 20 17:21:29 2002 EDT > > > > Modified files: > > /phpdoc/en/functions mysql.xml > > Log: > > See Bug #16187 The second parameter can't be used cause a number cannot > > be used as an object property. ie row->0 is invalid while row->field is, > > so MYSQL_NUM and MYSQL_BOTH don't matter it should always be MYSQL_ASSOC. > > Hold On!!! Look in the source!? The second param exists! That's why I > asked which was wrong?! The other point is that number object properties could exist. var_dump((object) array(1, 2, 3, 4)); hm... The same for var_dump((object) array("+=|__-=.:'[]" => 4)); Goba
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
Hold On!!! Look in the source!? The second param exists! That's why I asked which was wrong?! --Andrew On Wednesday 20 March 2002 04:21 pm, Chris Newbill wrote: > cnewbill Wed Mar 20 17:21:29 2002 EDT > > Modified files: > /phpdoc/en/functions mysql.xml > Log: > See Bug #16187 The second parameter can't be used cause a number cannot > be used as an object property. ie row->0 is invalid while row->field is, > so MYSQL_NUM and MYSQL_BOTH don't matter it should always be MYSQL_ASSOC. > > > Index: phpdoc/en/functions/mysql.xml > diff -u phpdoc/en/functions/mysql.xml:1.92 > phpdoc/en/functions/mysql.xml:1.93 --- > phpdoc/en/functions/mysql.xml:1.92Tue Mar 19 14:54:07 2002 > +++ phpdoc/en/functions/mysql.xml Wed Mar 20 17:21:29 2002 > @@ -1,5 +1,5 @@ > > - > + > >MySQL Functions >MySQL > @@ -1134,9 +1134,6 @@ > >objectmysql_fetch_object > > resourceresultm> - int > -result_type > - > > > Returns an object with properties that correspond to the fetched > @@ -1150,11 +1147,18 @@ > their offsets (numbers are illegal property names). > > > - The optional argument result_type is a > - constant and can take the following values: MYSQL_ASSOC, > - MYSQL_NUM, and MYSQL_BOTH. See > - mysql_fetch_array for explanation > - of these constants. > + > + > + > > > Speed-wise, the function is identical to -- Thus spake the master programmer: "When a program is being tested, it is too late to make design changes." -- Geoffrey James, "The Tao of Programming"
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
cnewbillWed Mar 20 17:21:29 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: See Bug #16187 The second parameter can't be used cause a number cannot be used as an object property. ie row->0 is invalid while row->field is, so MYSQL_NUM and MYSQL_BOTH don't matter it should always be MYSQL_ASSOC. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.92 phpdoc/en/functions/mysql.xml:1.93 --- phpdoc/en/functions/mysql.xml:1.92 Tue Mar 19 14:54:07 2002 +++ phpdoc/en/functions/mysql.xml Wed Mar 20 17:21:29 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1134,9 +1134,6 @@ objectmysql_fetch_object resourceresult - int -result_type - Returns an object with properties that correspond to the fetched @@ -1150,11 +1147,18 @@ their offsets (numbers are illegal property names). - The optional argument result_type is a - constant and can take the following values: MYSQL_ASSOC, - MYSQL_NUM, and MYSQL_BOTH. See - mysql_fetch_array for explanation - of these constants. + + + Speed-wise, the function is identical to
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
sander Tue Mar 19 14:54:07 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Clarified & cleared up mysql_change_user() a bit. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.91 phpdoc/en/functions/mysql.xml:1.92 --- phpdoc/en/functions/mysql.xml:1.91 Sun Mar 17 08:27:17 2002 +++ phpdoc/en/functions/mysql.xml Tue Mar 19 14:54:07 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -278,18 +278,16 @@ mysql_change_user changes the logged in user of the current active connection, or the connection given by the optional link_identifier parameter. If a - database is specified, this will default or current database after - the user has been changed. If the new user and password + database is specified, this will be the current database after + the user has been changed. If the new user and password authorization fails, the current connected user stays active. + &return.success; - - - This function was introduced in PHP 3.0.13 and requires MySQL - 3.23.3 or higher. + 3.23.3 or higher. It is not available in PHP 4.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
slawek Sun Mar 17 08:27:18 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: To many 'is' Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.90 phpdoc/en/functions/mysql.xml:1.91 --- phpdoc/en/functions/mysql.xml:1.90 Fri Mar 15 05:08:46 2002 +++ phpdoc/en/functions/mysql.xml Sun Mar 17 08:27:17 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -102,7 +102,7 @@ Resource types - There are two resource types used in the MySQL module. The first one isis + There are two resource types used in the MySQL module. The first one is the link identifier for a database connection, the second a resource which helds the result of a query.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Fri Mar 15 05:09:03 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: fixed bug 16090 (wrong table description) Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.89 phpdoc/en/functions/mysql.xml:1.90 --- phpdoc/en/functions/mysql.xml:1.89 Mon Mar 11 02:30:20 2002 +++ phpdoc/en/functions/mysql.xml Fri Mar 15 05:08:46 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -115,7 +115,7 @@ the different types of result arrays. The following constants are defined: - ncurses color constants + MySQL fetch constants
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
philip Fri Mar 8 15:27:33 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: mysql_connect: * new_link parameter became available in 4.2.0 * linked '@' to appropriate manual page Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.87 phpdoc/en/functions/mysql.xml:1.88 --- phpdoc/en/functions/mysql.xml:1.87 Wed Mar 6 05:39:29 2002 +++ phpdoc/en/functions/mysql.xml Fri Mar 8 15:27:33 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -321,7 +321,8 @@ PHP 3.0.10. - You can suppress the error message on failure by prepending '@' + You can suppress the error message on failure by prepending + a @ to the function name. @@ -330,11 +331,17 @@ If a second call is made to mysql_connect with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be - returned. The new_link modifies this behavior and - makes mysql_connect always open a new link, even if - mysql_connect was called before with the same - parameters. + returned. The new_link parameter modifies this + behavior and makes mysql_connect always open + a new link, even if mysql_connect was called + before with the same parameters. + + + The new_link parameter became available + in PHP 4.2.0 + + The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
derick Wed Mar 6 05:39:30 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: - Document the new "new_link" parameter to mysql_connect Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.86 phpdoc/en/functions/mysql.xml:1.87 --- phpdoc/en/functions/mysql.xml:1.86 Wed Feb 13 17:13:26 2002 +++ phpdoc/en/functions/mysql.xml Wed Mar 6 05:39:29 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -293,6 +293,9 @@ string password + bool +new_link + Returns a MySQL link identifier on success, or &false; on failure. @@ -327,7 +330,10 @@ If a second call is made to mysql_connect with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be - returned. + returned. The new_link modifies this behavior and + makes mysql_connect always open a new link, even if + mysql_connect was called before with the same + parameters. The link to the server will be closed as soon as the execution of
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Wed Feb 13 17:13:27 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: 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. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.85 phpdoc/en/functions/mysql.xml:1.86 --- phpdoc/en/functions/mysql.xml:1.85 Sat Feb 2 10:36:04 2002 +++ phpdoc/en/functions/mysql.xml Wed Feb 13 17:13:26 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -111,6 +111,9 @@ } print "\n"; +// Free resultset +mysql_free_result($result); + // Closing connection mysql_close($link); ?> @@ -1793,7 +1796,8 @@ - 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 @@ 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
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
kgergelyTue Jan 15 07:57:14 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Trailing spaces, tabs Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.82 phpdoc/en/functions/mysql.xml:1.83 --- phpdoc/en/functions/mysql.xml:1.82 Wed Jan 2 06:58:24 2002 +++ phpdoc/en/functions/mysql.xml Tue Jan 15 07:57:14 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -27,7 +27,7 @@ url="&url.mysql.docs;">&url.mysql.docs;. -The behaviour of the MySQL functions is affected by settings in the global +The behaviour of the MySQL functions is affected by settings in the global configuration file. MySQL Configuration Options @@ -122,7 +122,7 @@ -mysql_affected_rows +mysql_affected_rows Get number of affected rows in previous MySQL operation @@ -131,14 +131,14 @@ int mysql_affected_rows - resource + resource link_identifier - + mysql_affected_rows returns the number of rows affected by the last INSERT, UPDATE or DELETE query associated with link_identifier. If the @@ -183,7 +183,7 @@ -mysql_change_user +mysql_change_user Change logged in user of the active connection @@ -195,34 +195,34 @@ int mysql_change_user string user string password - string + string database - resource + resource link_identifier - + mysql_change_user changes the logged in user - of the current active connection, or the connection given by the + of the current active connection, or the connection given by the optional link_identifier parameter. If a database is 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. + 3.23.3 or higher. @@ -238,9 +238,9 @@ bool mysql_close - resource + resource -link_identifier +link_identifier @@ -256,12 +256,12 @@ Using mysql_close isn't usually necessary, as non-persistent open links are automatically closed at the end - of the script's execution. See also - freeing + of the script's execution. See also + freeing resources. - + mysql_close will not close persistent links created by mysql_pconnect. @@ -279,7 +279,7 @@ ]]> - + See also: mysql_connect, and mysql_pconnect. @@ -296,24 +296,24 @@ resource mysql_connect - string + string server - string + string username - string + string password - + Returns a MySQL link identifier on success, or &false; on failure. @@ -321,7 +321,7 @@ to a MySQL server. The following defaults are assumed for missing optional parameters: server = 'localhost:3306', username = name of the - user that owns the server process and + user that owns the server process and password = empty password. @@ -352,7 +352,7 @@ The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close. - + MySQL connect example @@ -384,14 +384,14 @@ bool mysql_create_db string database name - resource + resource link_identifier - + mysql_create_db attempts to create a new database on the server associated with the specified link identifier. @@ -415,11 +415,11 @@ ]]> - + For downwards compatibility mysql_createdb can also be used. This is deprecated, however. - + See also: mysql_drop_db. @@ -442,7 +442,7 @@ &return.success; - + mysql_data_seek moves the internal row pointer of the MySQL result associated with the specified result identifier to point to the specified row number. The next call @@ -500,14 +500,14 @@ string mysql_db_name resource result int row - mixed + mixed field - + mysql_db_name takes as its first parameter the result point
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jimwWed Jan 2 06:58:25 2002 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: mysql_tablename: use for loop in example Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.81 phpdoc/en/functions/mysql.xml:1.82 --- phpdoc/en/functions/mysql.xml:1.81 Sun Dec 30 12:20:27 2001 +++ phpdoc/en/functions/mysql.xml Wed Jan 2 06:58:24 2002 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -2156,11 +2156,9 @@ "; -$i++; } ?> ]]>
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
mrobinsoSun Dec 30 12:20:27 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: fix small typo Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.80 phpdoc/en/functions/mysql.xml:1.81 --- phpdoc/en/functions/mysql.xml:1.80 Sat Dec 22 16:19:07 2001 +++ phpdoc/en/functions/mysql.xml Sun Dec 30 12:20:27 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1856,7 +1856,7 @@ close links established by mysql_pconnect). - This type of links is therefore called 'persistent'. + This type of link is therefore called 'persistent'.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
slawek Sat Dec 22 16:19:07 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Typo in example Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.79 phpdoc/en/functions/mysql.xml:1.80 --- phpdoc/en/functions/mysql.xml:1.79 Wed Dec 12 15:47:08 2001 +++ phpdoc/en/functions/mysql.xml Sat Dec 22 16:19:07 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1144,7 +1144,7 @@
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
Hi Egon, >> Modified files: >> /phpdoc/en/functions mysql.xml >> Log: >> adding some php.ini related stuff in partintro. >> cleaning up the examples. some ws fixes. > It wasn´t necessary reformatting the documentation. Please stop such > commits. There is nothing wrong writing protos like: > function_name (arguments) > instead of > function_name(arguments) > I prefer the first. > -Egon This was not my idea. See the mail from Goba 4.12 Re: [PHP-DOC] persistent connections/mysql: > I think we should not put a space after the function name > and before the ( char. See the PEAR standards about this > thing. That space is used with control structures and > "functions" called without parenthesis (echo, print, include...). > This is not a major issue. There was no reaction from anyone to this statement -;) Therefore I thought this way of writing the protos is ok. One says care for the pear standards, others say do not. So how should this be done in the future? Friedhelm
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
betzMon Dec 10 16:33:53 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: adding some php.ini related stuff in partintro. cleaning up the examples. some ws fixes. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.77 phpdoc/en/functions/mysql.xml:1.78 --- phpdoc/en/functions/mysql.xml:1.77 Thu Dec 6 20:55:20 2001 +++ phpdoc/en/functions/mysql.xml Mon Dec 10 16:33:51 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -26,6 +26,60 @@ Documentation for MySQL can be found at &url.mysql.docs;. + +The behaviour of the MySQL functions is affected by settings in the global +configuration file. + + MySQL Configuration Options + + + +Name +Default +Changeable + + + + +mysql.allow_persistent +"On" +PHP_INI_SYSTEM + + +mysql.max_persistent +"-1" +PHP_INI_SYSTEM + + +mysql.max_links +"-1" +PHP_INI_SYSTEM + + +mysql.default_port +NULL +PHP_INI_ALL + + +mysql.default_socket +NULL +PHP_INI_ALL + + +mysql.default_host +NULL +PHP_INI_ALL + + +mysql.default_user +NULL +PHP_INI_ALL + + + + +For further details and definition of the PHP_INI_* constants see +ini_set. + This simple example shows how to connect, execute a query, print resulting rows and disconnect from a MySQL database. @@ -217,10 +271,10 @@ @@ -304,10 +358,10 @@ @@ -350,9 +404,9 @@ @@ -786,15 +840,16 @@ @@ -854,13 +909,15 @@ @@ -967,15 +1024,16 @@ @@ -1086,13 +1144,14 @@ @@ -1217,8 +1276,10 @@ // user_id // username // password. - -$res = mysql_db_query("users", "select * from users", $link); +$link = mysql_connect('localhost', $user, "secret"); +mysql_select_db($dbname, $link) +or die("Could not set $dbname"); +$res = mysql_query("select * from users", $link); echo mysql_field_name($res, 0) . "\n"; echo mysql_field_name($res, 2); @@ -1353,20 +1414,20 @@ @@ -1881,8 +1942,8 @@ @@ -1914,7 +1975,6 @@ See also: mysql_num_rows mysql_affected_rows, - mysql_db_query, mysql_unbuffered_query, mysql_free_result, mysql_fetch_array, @@ -2094,11 +2154,11 @@
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jimwThu Dec 6 20:55:21 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: add very generic warning about persistent connections needing a bit of tuning. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.76 phpdoc/en/functions/mysql.xml:1.77 --- phpdoc/en/functions/mysql.xml:1.76 Tue Nov 20 18:58:46 2001 +++ phpdoc/en/functions/mysql.xml Thu Dec 6 20:55:20 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1805,6 +1805,13 @@ Database Connections section for more information. + + + Using persistent connections can require a bit of tuning of your Apache + and MySQL configurations to ensure that you do not exceed the number of + connections allowed by MySQL. + +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
hholzgraMon Nov 19 12:10:35 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: typo fixes Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.74 phpdoc/en/functions/mysql.xml:1.75 --- phpdoc/en/functions/mysql.xml:1.74 Sat Nov 17 08:00:57 2001 +++ phpdoc/en/functions/mysql.xml Mon Nov 19 12:10:35 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1950,7 +1950,7 @@ mysql_result returns the contents of one cell from a MySQL result set. The field argument can be the field's offset, or the field's name, or the field's table dot - field's name (tabledname.fieldname). If the column name has been + field name (tablename.fieldname). If the column name has been aliased ('select foo as bar from...'), use the alias instead of the column name.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
gobaSat Nov 17 08:00:57 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Heh, build bug fixes... Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.73 phpdoc/en/functions/mysql.xml:1.74 --- phpdoc/en/functions/mysql.xml:1.73 Sat Nov 17 07:59:11 2001 +++ phpdoc/en/functions/mysql.xml Sat Nov 17 08:00:57 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -549,7 +549,7 @@ - &return.succes; + &return.success; mysql_drop_db attempts to drop (remove) an @@ -732,7 +732,7 @@ of the same name, you must use the numeric index of the column or make an alias for the column. For aliased columns, you cannot access the contents with the original column name (by using - 'field' in this example). + 'field' in this example). select tone.field as foo ttwo.field as bar from tone, ttwo @@ -815,7 +815,7 @@ the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using - mysql_fetch_row or add alias names. + mysql_fetch_row or add alias names. See the example at the mysql_fetch_array description about aliases. @@ -1381,7 +1381,7 @@ - &returns.success; + &return.success; For downward compatibility mysql_freeresult
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
gobaSat Nov 17 07:59:12 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Adding more see also information, description of MYSQL_... constants, more cross references, using &return.success; where applicable, more discussion of mysql_query() return value, etc. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.72 phpdoc/en/functions/mysql.xml:1.73 --- phpdoc/en/functions/mysql.xml:1.72 Sat Nov 17 06:43:14 2001 +++ phpdoc/en/functions/mysql.xml Sat Nov 17 07:59:11 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -324,7 +324,7 @@ Description - int mysql_create_db + bool mysql_create_db string database name resource @@ -338,7 +338,9 @@ database on the server associated with the specified link identifier. - + + &return.success; + MySQL create database example @@ -355,7 +357,7 @@ For downwards compatibility mysql_createdb - can also be used. + can also be used. This is deprecated, however. See also: mysql_drop_db. @@ -377,8 +379,8 @@ int row_number - - Returns: &true; on success, &false; on failure. + + &return.success; mysql_data_seek moves the internal row @@ -403,7 +405,7 @@ $result = mysql_query ($query) or die ("Query failed"); -# fetch rows in reverse order +// fetch rows in reverse order for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) { if (!mysql_data_seek ($result, $i)) { @@ -501,7 +503,7 @@ - Returns: A positive MySQL result resource to the query result, + Returns a positive MySQL result resource to the query result, or &false; on error. @@ -547,16 +549,19 @@ - Returns: &true; on success, &false; on failure. + &return.succes; mysql_drop_db attempts to drop (remove) an entire database from the server associated with the specified link identifier. + + For downward compatibility mysql_dropdb + can also be used. This is deprecated, however. + - See also: mysql_create_db. For downward - compatibility mysql_dropdb can also be used. + See also: mysql_create_db. @@ -724,25 +729,36 @@ If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) - of the same name, you must the numeric index of the column or - make an alias for the column. + of the same name, you must use the numeric index of the column or + make an alias for the column. For aliased columns, you cannot + access the contents with the original column name (by using + 'field' in this example). -select t1.f1 as foo t2.f1 as bar from t1, t2 +select tone.field as foo ttwo.field as bar from tone, ttwo An important thing to note is that using - mysql_fetch_array is NOT significantly - slower than using mysql_fetch_row, while it - provides a significant added value. + mysql_fetch_array is not + significantly slower than using + mysql_fetch_row, while it provides + a significant added value. The optional second argument result_type in mysql_fetch_array is a constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and - MYSQL_BOTH. (This feature was added in PHP 3.0.7) + MYSQL_BOTH. This feature was added in PHP 3.0.7. MYSQL_BOTH + is the default for this argument. + + + By using MYSQL_BOTH, you'll get an array with both associative + and number indices. Using MYSQL_ASSOC, you only get associative + indices (as mysql_fetch_assoc works), + using MYSQL_NUM, you only get number indices (as + mysql_fetch_row works). For further details, see also @@ -797,14 +813,17 @@ If two or more columns of the result have the same field names, the last column will take precedence. To access the other - column(s) of the same name, you must use - mysql_fetch_array and have it return the - numeric indices as well. + column(s) of the same name, you either need to access the + result with numeric indices by using + mysql_fetch_row or add alias names. + See the example at the mysql_fetch_array + description about aliases. An important thing to note is that using - mysql_fetch_assoc is NOT significantly - slower than using mysql_fetch_row, while it + mysql_fetch_assoc is not + significantly slower than using + mysql_fetch_row, while it provides a significant added value. @@ -981,7 +1000,7 @@ - Returns: An array that corresponds to the lengths of ea
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
gobaSat Nov 17 06:43:14 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Some enhancements Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.71 phpdoc/en/functions/mysql.xml:1.72 --- phpdoc/en/functions/mysql.xml:1.71 Sat Nov 17 06:31:21 2001 +++ phpdoc/en/functions/mysql.xml Sat Nov 17 06:43:14 2001 @@ -1,21 +1,21 @@ - + MySQL Functions MySQL These functions allow you to access MySQL database servers. In -order to have these functions available, you must compile php +order to have these functions available, you must compile PHP with MySQL support by using the --with-mysql option. If you -use this option without specifying the path to MySQL, php will +use this option without specifying the path to MySQL, PHP will use the built-in MySQL client libraries. Users who run other -applications that use MySQL (for example, running php3 and php4 +applications that use MySQL (for example, running PHP 3 and PHP 4 as concurrent apache modules, or auth-mysql) should always specify the path to MySQL: --with-mysql=/path/to/mysql. -This will force php to use the client libraries installed by +This will force PHP to use the client libraries installed by MySQL, avoiding any conflicts. @@ -28,7 +28,7 @@ This simple example shows how to connect, execute a query, print -resulting rows and disconnect from MySQL Database. +resulting rows and disconnect from a MySQL database. MySQL extension overview example @@ -50,8 +50,8 @@ print "\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { print "\t\n"; -foreach ($line as $col_name => $col_value) { -print "\t\t$col_name$col_value\n"; +foreach ($line as $col_value) { +print "\t\t$col_value\n"; } print "\t\n"; } @@ -156,10 +156,10 @@ mysql_change_user changes the logged in user of the current active connection, or the connection given by the - optional parameter link_identifier. If a database is - 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. + optional link_identifier parameter. If a + database is 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. @@ -192,7 +192,7 @@ - Returns: &true; on success, &false; on error. + &return.success; mysql_close closes the connection to the MySQL server that's associated with the specified link
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
gobaSat Nov 17 06:31:22 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: More correct example, applying PEAR code standars, and using CDATA to ease the work of manual people ;) Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.70 phpdoc/en/functions/mysql.xml:1.71 --- phpdoc/en/functions/mysql.xml:1.70 Fri Nov 16 17:29:07 2001 +++ phpdoc/en/functions/mysql.xml Sat Nov 17 06:31:21 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -32,31 +32,35 @@ MySQL extension overview example -
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
hholzgraFri Nov 16 17:22:18 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: removed optional bloat from prototypes Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.68 phpdoc/en/functions/mysql.xml:1.69 --- phpdoc/en/functions/mysql.xml:1.68 Fri Nov 16 13:58:43 2001 +++ phpdoc/en/functions/mysql.xml Fri Nov 16 17:22:18 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -238,10 +238,7 @@ resource mysql_connect string -hostname - :port - :/path/to/socket - +server string @@ -262,13 +259,13 @@ mysql_connect establishes a connection to a MySQL server. The following defaults are assumed for - missing optional parameters: host:port = + missing optional parameters: server = 'localhost:3306', username = name of the user that owns the server process and password = empty password. - The hostname string can also include a port + The server parameter can also include a port number. eg. "hostname:port" or a path to a socket eg. ":/path/to/socket" for the localhost. @@ -1685,10 +1682,7 @@ resource mysql_pconnect string -hostname - :port - :/path/to/socket - +server string @@ -1706,13 +1700,13 @@ mysql_pconnect establishes a connection to a MySQL server. The following defaults are assumed for - missing optional parameters: host:port = + missing optional parameters: server = 'localhost:3306', username = name of the user that owns the server process and password = empty password. - The hostname string can also include a port + The server parameter can also include a port number. eg. "hostname:port" or a path to a socket eg. ":/path/to/socket" for the localhost.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
derick Fri Nov 16 13:58:43 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: - Clarify a little bit Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.67 phpdoc/en/functions/mysql.xml:1.68 --- phpdoc/en/functions/mysql.xml:1.67 Sat Nov 10 16:49:39 2001 +++ phpdoc/en/functions/mysql.xml Fri Nov 16 13:58:43 2001 @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -1829,8 +1829,8 @@ statement. - For SELECT statements, mysql_query returns a - new result identifier that you can pass to + Only for SELECT statements, mysql_query + returns a new result identifier that you can pass to mysql_result. When you are done with the result set, you can free the resources associated with it by calling mysql_free_result. Although, the
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
eschmid Sun Sep 2 07:39:06 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Only whitespace. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.64 phpdoc/en/functions/mysql.xml:1.65 --- phpdoc/en/functions/mysql.xml:1.64 Sat Sep 1 08:53:45 2001 +++ phpdoc/en/functions/mysql.xml Sun Sep 2 07:39:05 2001 @@ -1,7 +1,7 @@ - + - MySQL functions + MySQL Functions MySQL @@ -46,12 +46,12 @@ // printing HTML result print "\n"; - while($line = mysql_fetch_array($result)){ - print "\t
\n"; @@ -155,13 +155,18 @@ optional parameter link_identifier. If a database is 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. + the current connected user stays active. + - - This function was introduced in PHP 3.0.13 and - requires MySQL 3.23.3 or higher. - + + + + + This function was introduced in PHP 3.0.13 and requires MySQL + 3.23.3 or higher. + + @@ -275,8 +280,8 @@ PHP 3.0.10. - You can suppress the error message on failure by prepending '@' - to the function name. + You can suppress the error message on failure by prepending '@' + to the function name. @@ -295,17 +300,15 @@ MySQL connect example See also - mysql_pconnect, and + mysql_pconnect and mysql_close. @@ -385,7 +388,6 @@ Row_number starts at 0. - MySQL data seek example @@ -447,14 +449,12 @@ row parameter is an index into the result set. - If an error occurs, &false; is returned. Use mysql_errno and mysql_error to determine the nature of the error. - mysql_db_name example @@ -473,12 +473,10 @@ ?> - For backward compatibility, mysql_dbname is also accepted. This is deprecated, however. - @@ -565,8 +563,10 @@ mysql_errno -Returns the numerical value of the error message from previous - MySQL operation + + Returns the numerical value of the error message from previous + MySQL operation + Description @@ -615,8 +615,10 @@ mysql_error -Returns the text of the error message from previous - MySQL operation + + Returns the text of the error message from previous MySQL + operation + Description @@ -682,8 +684,8 @@ - mysql_escape_string does not escape % - and _. + mysql_escape_string does not escape + % and _. @@ -743,7 +745,8 @@ For further details, see also - mysql_fetch_row and mysql_fetch_assoc. + mysql_fetch_row and + mysql_fetch_assoc. mysql_fetch_array example @@ -783,7 +786,7 @@ Returns an associative array that corresponds to the fetched row, or &false; if there are no more rows. - mysql_fetch_assoc is equivalent to calling + mysql_fetch_assoc is equivalent to calling mysql_fetch_array with MYSQL_ASSOC for the optional second parameter. It only returns an associative array. This is the way mysql_fetch_array originally @@ -792,9 +795,10 @@ If two or more columns of the result have the same field names, - the last column will take precedence. To access the other column(s) - of the same name, you must use mysql_fetch_array and - have it return the numeric indices as well. + the last column will take precedence. To access the other + column(s) of the same name, you must use + mysql_fetch_array and have it return the + numeric indices as well. An important thing to note is that using @@ -804,7 +808,8 @@ For further details, see also - mysql_fetch_row and mysql_fetch_array. + mysql_fetch_row and + mysql_fetch_array. mysql_fetch_assoc @@ -823,7 +828,7 @@ - + mysql_fetch_field @@ -14\n"; - while(list($col_name, $col_value) = each($line)){ - print "\t\t \n"; + while ($line = mysql_fetch_array($result)) { + print "\t$col_value \n"; - } - print "\t\n"; + while(list($col_name, $col_value) = each($line)) { + print "\t\t \n"; } print "$col_value \n"; + } + print "\t
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jah Sat Sep 1 08:53:45 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Fixed closing tag. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.63 phpdoc/en/functions/mysql.xml:1.64 --- phpdoc/en/functions/mysql.xml:1.63 Thu Aug 30 16:36:21 2001 +++ phpdoc/en/functions/mysql.xml Sat Sep 1 08:53:45 2001 @@ -1,5 +1,5 @@ - + MySQL functions MySQL @@ -1834,7 +1834,7 @@ See also: mysql_affected_rows, mysql_db_query, mysql_unbuffered_query, - mysql_free_result/function>, + mysql_free_result, mysql_result, mysql_select_db, and mysql_connect.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
georg Thu Aug 30 16:36:22 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Bug: 12823 - Changed mysql_unbuffered_query description killed 3rd parameter, mysql_unbuffered_query only accepts 2 parms inserted description for 2nd parameter Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.62 phpdoc/en/functions/mysql.xml:1.63 --- phpdoc/en/functions/mysql.xml:1.62 Thu Aug 30 12:51:12 2001 +++ phpdoc/en/functions/mysql.xml Thu Aug 30 16:36:21 2001 @@ -1,5 +1,5 @@ - + MySQL functions MySQL @@ -1834,7 +1834,7 @@ See also: mysql_affected_rows, mysql_db_query, mysql_unbuffered_query, - mysql_free_result, + mysql_free_result/function>, mysql_result, mysql_select_db, and mysql_connect. @@ -1856,13 +1856,10 @@ resource link_identifier - int - result_mode - - + - mysql_unbuffered_query sends a SQL query to MySQL, + mysql_unbuffered_query sends a SQL query +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 @@ -1870,6 +1867,7 @@ 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. + When using multiple DB-connects, you have to specify the optional parameter +link_identifier.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
gobaThu Aug 30 12:49:52 2001 EDT Removed files: /phpdoc/en/functionsmysql.xml Log: Removing file, to prevent big useless diff, I'll readd it ASAP.
Re: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml
AA! Why have you modified the english version to be hungarian??? Please revert the change This was not a too good idea Goba - Original Message - From: "Kontra Gergely" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 30, 2001 6:35 PM Subject: [PHP-DOC] cvs: phpdoc /en/functions mysql.xml > kgergely Thu Aug 30 12:35:10 2001 EDT > > Modified files: > /phpdoc/en/functions mysql.xml > Log: > > >
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jeroen Mon Aug 13 14:46:30 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Fix a build-error, that's why it didn't build yesterday :(... Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.57 phpdoc/en/functions/mysql.xml:1.58 --- phpdoc/en/functions/mysql.xml:1.57 Sun Aug 12 20:27:15 2001 +++ phpdoc/en/functions/mysql.xml Mon Aug 13 14:46:29 2001 @@ -1,4 +1,4 @@ - + MySQL functions MySQL @@ -518,9 +518,11 @@ - This function has been deprecated since PHP 4.0.6. - Do not use this function. Use mysql_select_db - and mysql_query instead. + + This function has been deprecated since PHP 4.0.6. + Do not use this function. Use mysql_select_db + and mysql_query instead. + @@ -2131,5 +2133,5 @@ sgml-local-catalogs:nil sgml-local-ecat-files:nil End: -vim: ts=1 sw=1 et syntax=sgml +vi: et:ts=1:sw=1:textwidth=78:syntax=sgml -->
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
sniper Sun Aug 12 20:27:16 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: added note about mysql_db_query() been deprecated. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.56 phpdoc/en/functions/mysql.xml:1.57 --- phpdoc/en/functions/mysql.xml:1.56 Sun Aug 12 18:43:08 2001 +++ phpdoc/en/functions/mysql.xml Sun Aug 12 20:27:15 2001 @@ -1,4 +1,4 @@ - + MySQL functions MySQL @@ -517,8 +517,11 @@ mysql_query. - For downwards - compatibility mysql can also be used. + + This function has been deprecated since PHP 4.0.6. + Do not use this function. Use mysql_select_db + and mysql_query instead. +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
tom Tue Aug 7 01:20:38 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Typo (bug#12347) Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.54 phpdoc/en/functions/mysql.xml:1.55 --- phpdoc/en/functions/mysql.xml:1.54 Thu Aug 2 13:37:11 2001 +++ phpdoc/en/functions/mysql.xml Tue Aug 7 01:20:37 2001 @@ -1,4 +1,4 @@ - + MySQL functions MySQL @@ -1704,7 +1704,7 @@ eg. ":/path/to/socket" for the localhost. - Support for ":port" wass added in 3.0B4. + Support for ":port" was added in 3.0B4. Support for the ":/path/to/socket" was added in
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
damsMon May 21 02:37:24 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Added last mysql_get_*_info.TODO : check version availability, add examples. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.45 phpdoc/en/functions/mysql.xml:1.46 --- phpdoc/en/functions/mysql.xml:1.45 Sat May 19 15:03:50 2001 +++ phpdoc/en/functions/mysql.xml Mon May 21 02:37:24 2001 @@ -625,7 +625,7 @@ mysql_escape_string - Escapes a string for use in a MySQL-query. + Escapes a string for use in a mysql_query. @@ -638,7 +638,7 @@ This function will escape the unescaped_string, - so that it is safe to place it in a MySQL-query. + so that it is safe to place it in a mysql_query. @@ -1979,6 +1979,104 @@ + + +mysql_get_client_info +Get MySQL client info + + +Description + + + string mysql_get_client_info + void + + + + mysql_get_client_info returns a string that represents + the client library version. + + + mysql_get_client_info was added in PHP 4.0.5. + + + + + + +mysql_get_host_info +Get MySQL host info + + +Description + + + string mysql_get_host_info + resource +link_identifier + + + + mysql_get_host_info returns a string + describing the type of connection in use for the connection + link_identifier, including the server host name. + If link_identifier is omited, the last opened + connection will be used. + + + mysql_get_host_info was added in PHP 4.0.5. + + + + + + +mysql_get_proto_info +Get MySQL protocol info + + +Description + + + int mysql_get_proto_info + resource +link_identifier + + + + mysql_get_proto_info returns the protocol version + used by connection link_identifier. + If link_identifier is omited, the last opened + connection will be used. + + + mysql_get_proto_info was added in PHP 4.0.5. + + + + + + +mysql_get_server_info +Get MySQL server info + + +Description + + + int mysql_get_server_info + resource +link_identifier + + + + mysql_get_server_info returns the server version + used by connection link_identifier. + If link_identifier is omited, the last opened + connection will be used. + + + mysql_get_server_info was added in PHP 4.0.5. + + +
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jeroen Sat May 19 15:03:50 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Added mysql_fetch_assoc (wondering why it wasn't documented ;-) Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.44 phpdoc/en/functions/mysql.xml:1.45 --- phpdoc/en/functions/mysql.xml:1.44 Sat May 19 13:39:38 2001 +++ phpdoc/en/functions/mysql.xml Sat May 19 15:03:50 2001 @@ -724,7 +724,66 @@ - + + +mysql_fetch_assoc + + Fetch a result row as an associative array + + + +Description + + + array mysql_fetch_assoc + resource result + + + + Returns an associative array that corresponds to the fetched row, + or false if there are no more rows. + + mysql_fetch_assoc is equivalent to calling + mysql_fetch_array with MYSQL_ASSOC for the + optional second parameter. It only returns an associative array. + This is the way mysql_fetch_array originally + worked. If you need the numeric indices as well as the + associative, use mysql_fetch_array. + + + If two or more columns of the result have the same field names, + the last column will take precedence. To access the other column(s) + of the same name, you must use mysql_fetch_array and + have it return the numeric indices as well. + + + An important thing to note is that using + mysql_fetch_assoc is NOT significantly + slower than using mysql_fetch_row, while it + provides a significant added value. + + + For further details, see also + mysql_fetch_row and mysql_fetch_array. + + + Mysql_fetch_assoc + + + + + + + + mysql_fetch_field
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jeroen Sat May 19 13:39:38 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: - added mysql_escape_string - made case of MySQL consistent Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.43 phpdoc/en/functions/mysql.xml:1.44 --- phpdoc/en/functions/mysql.xml:1.43 Wed May 16 15:52:23 2001 +++ phpdoc/en/functions/mysql.xml Sat May 19 13:39:38 2001 @@ -5,16 +5,16 @@ These functions allow you to access MySQL database servers. In order to have these functions available, you must compile php -with mysql support by using the +with MySQL support by using the --with-mysql option. If you -use this option without specifying the path to mysql, php will -use the built-in mysql client libraries. Users who run other -applications that use mysql (for example, running php3 and php4 +use this option without specifying the path to MySQL, php will +use the built-in MySQL client libraries. Users who run other +applications that use MySQL (for example, running php3 and php4 as concurrent apache modules, or auth-mysql) should always -specify the path to mysql: +specify the path to MySQL: --with-mysql=/path/to/mysql. This will force php to use the client libraries installed by -mysql, avoiding any conflicts. +MySQL, avoiding any conflicts. More information about MySQL can be found at - Returns the error number from the last mySQL function, or + Returns the error number from the last MySQL function, or 0 (zero) if no error occurred. - Errors coming back from the mySQL database backend no longer + Errors coming back from the MySQL database backend no longer issue warnings. Instead, use mysql_errno to retrieve the error code. Note that this function only returns the - error code from the most recently executed mySQL function (not + 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 @@ -591,17 +591,17 @@ - Returns the error text from the last mySQL function, or + Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred. - Errors coming back from the mySQL database backend no longer + Errors coming back from the MySQL database backend no longer issue warnings. Instead, use mysql_error to retrieve the error text. Note that this function only returns the - error text from the most recently executed mySQL function (not + error text 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 function. + sure you check the value before calling another MySQL function.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jeroen Wed May 16 15:52:23 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Applied int -> resource to new function too Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.42 phpdoc/en/functions/mysql.xml:1.43 --- phpdoc/en/functions/mysql.xml:1.42 Wed May 16 15:46:43 2001 +++ phpdoc/en/functions/mysql.xml Wed May 16 15:52:23 2001 @@ -1783,9 +1783,9 @@ Description - int mysql_unbuffered_query + resource mysql_unbuffered_query string query - int + resource link_identifier int
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jeroen Wed May 16 15:46:44 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Reapplied 1.37 -> 1.40 patches Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.41 phpdoc/en/functions/mysql.xml:1.42 --- phpdoc/en/functions/mysql.xml:1.41 Wed May 16 08:25:31 2001 +++ phpdoc/en/functions/mysql.xml Wed May 16 15:46:43 2001 @@ -479,7 +479,8 @@ arguments - See also mysql_connect. + See also mysql_connect and + mysql_query. For downwards @@ -1764,10 +1765,55 @@ See also: mysql_affected_rows, mysql_db_query, + mysql_unbuffered_query, mysql_free_result, mysql_result, mysql_select_db, and mysql_connect. + + + + + + +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.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jeroen Wed May 16 08:25:31 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: - Fixed types - Removed outdated para - Added some return description, and comments where still undocumented Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.40 phpdoc/en/functions/mysql.xml:1.41 --- phpdoc/en/functions/mysql.xml:1.40 Tue May 15 05:18:59 2001 +++ phpdoc/en/functions/mysql.xml Wed May 16 08:25:31 2001 @@ -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
\n", $row->last_name, $row->first_name); +echo ("$row->last_name $row->first_name
\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 @@ Description - int mysql_db_query + resource mysql_db_query string database string query - int + resource link_identifier @@ -462,7 +467,7 @@ - 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 @@ arguments - See also mysql_connect and - mysql_query. + See also mysql_connect. For downwards @@ -493,9 +497,9 @@ Description - int mysql_drop_db + bool mysql_drop_db string database_name - int + resource link_identifier @@ -528,7 +532,7 @@ int mysql_errno - int + resource link_identifier @@ -578,7 +582,7 @@ string mysql_error - int + resource link_identifier @@ -628,7 +632,7 @@ array mysql_fetch_array - int result + resource result int result_type @@ -703,7 +707,7 @@ array mysql_fetch_assoc - int result + resource result @@ -762,7 +766,7 @@ object mysql_fetch_field - int result + resource result int field_offset @@ -898,7 +902,7 @@ array mysql_fetch_lengths - int result + resource result @@ -930,7 +934,7 @@ object mysql_fetch_object - int result + resource result int result_type @@ -991,7 +995,7 @@ array mysql_fetch_ro
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
damsTue May 15 05:18:59 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Added mysql_query in mysql_db_query related links. Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.39 phpdoc/en/functions/mysql.xml:1.40 --- phpdoc/en/functions/mysql.xml:1.39 Sun May 13 09:50:25 2001 +++ phpdoc/en/functions/mysql.xml Tue May 15 05:18:59 2001 @@ -474,7 +474,8 @@ arguments - See also mysql_connect. + See also mysql_connect and + mysql_query. For downwards
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
sbergmann Fri May 11 23:13:23 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: Added documentation for mysql_unbuffered_query(). Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.37 phpdoc/en/functions/mysql.xml:1.38 --- phpdoc/en/functions/mysql.xml:1.37 Thu Mar 8 13:56:37 2001 +++ phpdoc/en/functions/mysql.xml Fri May 11 23:13:23 2001 @@ -1756,6 +1756,50 @@ + + +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
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
danbeck Thu Mar 8 13:56:37 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: added errata clarification and clean up some function examples Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.36 phpdoc/en/functions/mysql.xml:1.37 --- phpdoc/en/functions/mysql.xml:1.36 Thu Feb 15 16:15:33 2001 +++ phpdoc/en/functions/mysql.xml Thu Mar 8 13:56:37 2001 @@ -46,10 +46,11 @@ - mysql_affected_rows returns the number of - rows affected by the last INSERT, UPDATE or DELETE query on the - server associated with the specified link identifier. If the - link identifier isn't specified, the last opened link is assumed. + mysql_affected_rows returns the number + of rows affected by the last INSERT, UPDATE or DELETE query + associated with link_identifier. If the + link identifier isn't specified, the last link opened by + mysql_connect is assumed. @@ -63,14 +64,27 @@ of the records will have been deleted from the table but this function will return zero. + + + When using UPDATE, MySQL will not update columns where the new + value is the same as the old value. This creates the possiblity + that mysql_affected_rows may not actually + equal the number of rows matched, only the number of rows that + were literally affected by the query. + + - This command is not effective for SELECT statements, only on - statements which modify records. To retrieve the number of rows - returned from a SELECT, use mysql_num_rows. + mysql_affected_rows does not work with + SELECT statements; only on statements which modify records. To + retrieve the number of rows returned by a SELECT, use + mysql_num_rows. If the last query failed, this function will return -1. + + See also: mysql_num_rows. + @@ -242,11 +256,13 @@ MySQL connect example + +?> See also @@ -1533,29 +1549,30 @@ mysql_num_rows returns the number of rows in a result set. This command is only valid for SELECT statements. To retrieve the number of rows returned from a INSERT, UPDATE or - DELETE, use mysql_affected_rows. + DELETE query, use mysql_affected_rows. - - -mysql_num_rows example by [EMAIL PROTECTED] - - + mysql_num_rows example + +$link = mysql_connect("localhost", "username", "password"); +mysql_select_db("database", $link); + +$result = mysql_query("SELECT * FROM table1", $link); +$num_rows = mysql_num_rows($result); + +echo "$num_rows Rows\n"; + +?> See also: - mysql_db_query, - mysql_query and, - mysql_fetch_row. + mysql_affected_rows, + mysql_connect, + mysql_select_db and + mysql_query. For downward compatibility mysql_numrows can
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
derick Thu Feb 15 16:15:34 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: - Fixed a typo Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.35 phpdoc/en/functions/mysql.xml:1.36 --- phpdoc/en/functions/mysql.xml:1.35 Mon Jan 22 18:07:46 2001 +++ phpdoc/en/functions/mysql.xml Thu Feb 15 16:15:33 2001 @@ -1762,7 +1762,7 @@ mysql_result returns the contents of one cell from a MySQL result set. The field argument can be the field's offset, or the field's name, or the field's table dot - field's name (fieldname.tablename). If the column name has been + field's name (tabledname.fieldname). If the column name has been aliased ('select foo as bar from...'), use the alias instead of the column name.
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jimwMon Jan 22 18:07:46 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: note that mysql_affected_rows must be called before commit when using transactions Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.34 phpdoc/en/functions/mysql.xml:1.35 --- phpdoc/en/functions/mysql.xml:1.34 Mon Jan 22 17:26:21 2001 +++ phpdoc/en/functions/mysql.xml Mon Jan 22 18:07:46 2001 @@ -51,6 +51,13 @@ server associated with the specified link identifier. If the link identifier isn't specified, the last opened link is assumed. + + + If you are using transactions, you need to call + mysql_affected_rows after your INSERT, + UPDATE, or DELETE query, not after the commit. + + If the last query was a DELETE query with no WHERE clause, all of the records will have been deleted from the table but this
[PHP-DOC] cvs: phpdoc /en/functions mysql.xml
jimwMon Jan 22 17:26:21 2001 EDT Modified files: /phpdoc/en/functionsmysql.xml Log: not return of mysql_affected_row when query had failed Index: phpdoc/en/functions/mysql.xml diff -u phpdoc/en/functions/mysql.xml:1.33 phpdoc/en/functions/mysql.xml:1.34 --- phpdoc/en/functions/mysql.xml:1.33 Sat Jan 20 13:08:27 2001 +++ phpdoc/en/functions/mysql.xml Mon Jan 22 17:26:21 2001 @@ -61,6 +61,9 @@ statements which modify records. To retrieve the number of rows returned from a SELECT, use mysql_num_rows. + + If the last query failed, this function will return -1. +