PHP 手冊
上一頁 |  | 下一頁

# mysql_stat

(PHP 4 >= 4.3.0, PHP 5)

mysql_stat -- Get current system status

## Description

string mysql_stat ( [resource link_identifier])

mysql_stat() returns the current server status.

> 備注: 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.

示範 1.mysql_stat() example
`<?php $link = mysql_connect('localhost', "mysql_user", "mysql_password"); $status = explode(' ', mysql_stat($link)); print_r($status); ?>`
The above example would produce the following output:
    Array
    (
        [0] => Uptime: 5380
        [1] => Threads: 2
        [2] => Questions: 1321299
        [3] => Slow queries: 0
        [4] => Opens: 26
        [5] => Flush tables: 1
        [6] => Open tables: 17
        [7] => Queries per second avg: 245.595
    )

See also mysql_get_server_info() and mysql_list_processes().

上一頁 | 最開頭 | 下一頁
mysql_select_db | 上一層 | mysql_tablename