documentation for new functions: mysql_stat and mysql_list_processes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@74999 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Georg Richter 2002-03-24 10:53:30 +00:00
parent d4730c39d2
commit 603d9730b6

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.95 $ -->
<!-- $Revision: 1.96 $ -->
<reference id="ref.mysql">
<title>MySQL Functions</title>
<titleabbrev>MySQL</titleabbrev>
@ -1670,6 +1670,54 @@ field3
</refsect1>
</refentry>
<refentry id="function.mysql-list-processes">
<refnamediv>
<refname>mysql_list_processes</refname>
<refpurpose>List MySQL processes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>mysql_list_processes</methodname>
<methodparam choice="opt"><type>resource</type><parameter>
link_identifier
</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_list_processes</function> returns a result pointer
describing the current server threads.
</para>
<para>
<example>
<title><function>mysql_list_processes</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$link = mysql_connect('localhost', 'myname', 'secret');
$result = mysql_list_processes($link);
while ($row = mysql_fetch_row($result)){
printf("%s %s %s %s %s\n", $row["Id"], $row["Host"], $row["db"],
$row["Command"], $row["Time"]);
}
mysql_free_result ($result);
]]>
</programlisting>
<para>
The above example would produce the following output:
<screen>
<![CDATA[
1 localhost test Processlist 0
4 localhost mysql sleep 5
]]>
</screen>
</para>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.mysql-list-tables">
<refnamediv>
<refname>mysql_list_tables</refname>
@ -2226,6 +2274,51 @@ for ($i = 0; $i < mysql_num_rows($result); $i++) {
</para>
</refsect1>
</refentry>
<refentry id="function.mysql-stat">
<refnamediv>
<refname>mysql_stat</refname>
<refpurpose>Get current system status</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>mysql_stat</methodname>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_stat</function> returns the current server status.
</para>
<note>
<para>
<function>mysql_stat</function> 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.
</para>
</note>
<para>
<example>
<title><function>mysql_stat</function> example</title>
<programlisting role="php">
<![CDATA[
$link = mysql_connect('localhost', $user, "secret");
printf("%s\n", mysql_stat($link));
]]>
</programlisting>
<para>
The above example would produce the following output:
<screen>
<![CDATA[
Uptime: 5380 Threads: 1 Questions: 1321299 Slow queries: 1 Opens: 26 Flush tables: 1 Open tables: 17 Queries per second avg: 245.595
]]>
</screen>
</para>
</example>
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file