mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-22 03:48:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@189110 c90b9560-bf6c-de11-be94-00142212c4b1
115 lines
2.9 KiB
XML
115 lines
2.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.8 $ -->
|
|
<refentry id="function.mysqli-stat">
|
|
<refnamediv>
|
|
<refname>mysqli_stat</refname>
|
|
<refname>mysqli->stat</refname>
|
|
<refpurpose>Gets the current system status</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>Procedural style:</para>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mysqli_stat</methodname>
|
|
<methodparam><type>mysqli</type><parameter>link</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>Object oriented style (method):</para>
|
|
<classsynopsis>
|
|
<ooclass><classname>mysqli</classname></ooclass>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>stat</methodname>
|
|
<void />
|
|
</methodsynopsis>
|
|
</classsynopsis>
|
|
<para>
|
|
<function>mysqli_stat</function> returns a string containing
|
|
information similar to that provided by the 'mysqladmin status' command.
|
|
This includes uptime in seconds and the number of running threads,
|
|
questions, reloads, and open tables.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1>
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
A string describing the server status. &false; if an error occurred.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1>
|
|
&reftitle.seealso;
|
|
<para>
|
|
<function>mysqli_get_server_info</function>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1>
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Object oriented style</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
|
|
|
/* check connection */
|
|
if (mysqli_connect_errno()) {
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
exit();
|
|
}
|
|
|
|
printf ("System status: %s\n", $mysqli->stat());
|
|
|
|
$mysqli->close();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>Procedural style</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
|
|
|
/* check connection */
|
|
if (mysqli_connect_errno()) {
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
exit();
|
|
}
|
|
|
|
printf("System status: %s\n", mysqli_stat($link));
|
|
|
|
mysqli_close($link);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
System status: Uptime: 272 Threads: 1 Questions: 5340 Slow queries: 0
|
|
Opens: 13 Flush tables: 1 Open tables: 0 Queries per second avg: 19.632
|
|
Memory in use: 8496K Max memory used: 8560K
|
|
]]>
|
|
</screen>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|