|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55666 mysql_stat says questions but outputs queries information_schema.global_statu
Submitted: 2011-09-10 16:17 UTC Modified: 2011-09-25 13:49 UTC
From: linuxaomi at operamail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.3SVN-2011-09-10 (SVN) OS: LINUX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 + 26 = ?
Subscribe to this entry?

 [2011-09-10 16:17 UTC] linuxaomi at operamail dot com
PHP 5.3.5 / MySQL 5.5.8 / XAMPP 1.7.4 for LINUX

MySQL maintains two variables in information_schema.global_status: QUERIES and QUESTIONS. mysql_stat throws QUESTIONS but displays variable QUERIES.

Problem has also been around in PHP 5.1

Test script:
from documentation

$link   = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$status = explode('  ', mysql_stat($link));
    [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

Expected result:
[2] => Queries: 1321299


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-25 13:21 UTC]
-Status: Open +Status: Bogus
 [2011-09-25 13:21 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is the behavior of libmysql to which PHP and mysqlnd are compatible. See and

If you want this to be changed report this as abug to MySQL/Oracle.
 [2011-09-25 13:49 UTC] linuxaomi at operamail dot com
Hello Johannes,

please be more specific. Which chapter/sentence of the mentioned URLs I am supposed to read?
I also cannot see what went wrong reporting this discrepancy. As a matter of fact MySQL just provides two fields with individual fieldnames and contents.
PHP reports FIELDA: content(FIELDB) rather than FIELDA: content(FIELDA) or FIELDB: content(FIELDB). Can you comprehend?

Best regards,
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 10:01:31 2024 UTC