From 7f6f235b80b84e4a3da59ec619192fe9a2f6990b Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 25 Mar 2002 12:22:22 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@75137 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mysql.xml | 220 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 213 insertions(+), 7 deletions(-) diff --git a/functions/mysql.xml b/functions/mysql.xml index ac08586da7..bf245470b3 100644 --- a/functions/mysql.xml +++ b/functions/mysql.xml @@ -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. + + + <function>mysql_character_set_name</function> example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_real_escape_string + + + + mysql_close @@ -786,10 +828,10 @@ echo mysql_errno().": ".mysql_error()."
";
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 @@ echo mysql_errno().": ".mysql_error()."
"; 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. + + + <function>mysql_real_escape_string</function> example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_real_escape_string +
@@ -1715,6 +1789,10 @@ mysql_free_result ($result); + + See also: + mysql_thread_id + @@ -1906,6 +1984,36 @@ echo "$num_rows Rows\n"; + + + 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 @@ $result = mysql_query("SELECT my_col FROM my_tbl") + + + 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 _. + + + + <function>mysql_real_escape_string</function> example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_escape_string + mysql_character_set_name + + + + mysql_result @@ -2182,6 +2345,49 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) { + + + 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. + + + <function>mysql_list_processes</function> example + + + + + The above example would produce the following output: + + + + + + + See also: + mysql_ping + mysql_list_processes + + + + mysql_get_client_info @@ -2218,7 +2424,7 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) { 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 + name. If link_identifier is omitted, the last opened connection will be used. @@ -2294,7 +2500,7 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) { 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.