|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-01 21:26 UTC] haafiz at ezwebsolutions dot ca
When I call mysql_stat(), it returns a string like this:
Uptime: 1182208 Threads: 13 Questions: 745284 Slow queries: 1 Opens: 2210 Flush tables: 1 Open tables: 12 Queries per second avg: 0.630
All the fields are supposed to have two spaces (" ") between each of them so that an explode() will work on it.
However, you will notice that there is only 1 space (" ") between the value of "Open Tables" and the caption "Queries per second avg:"
Is this how it is supposed to be? Or is this a minor bug?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 09:00:01 2025 UTC |
In fact there are more space but the HTML output will read only one. Use explode('[[:space:]]',$var) to divide it. (You can verify that by looking at the HTML source.I also added this workaround to the doc page. $stat = explode(' ',mysql_stat($this->c_id)); list($stat[6],$stat[7]) = preg_split('/\s(Q.+)/',$stat[6],-1,PREG_SPLIT_DELIM_CAPTURE);