note 90630 added to mysqli.stat

From: Date: Fri, 01 May 2009 13:10:07 +0000
Subject: note 90630 added to mysqli.stat
Groups: php.notes 
Request: Send a blank email to php-notes+get-154076@lists.php.net to get a copy of this message
PHP 5.2.9 A small example <?php $dbh = new mysqli('host', 'user', 'password', 'database'); if ($dbh->connect_error) { die("Connection Error ({$dbh->connect_errno}) {$dbh->connect_error}"); } if (($stats = $dbh->stat()) !== FALSE) { echo "Dumping output method stat() ...\n"; echo "$stats\n"; $statsArray = explode(" ", $stats); print_r($stats); } ?> Dumping stats: Uptime: 1095822 Threads: 5 Questions: 5326101 Slow queries: 0 Opens: 7352 Flush tables: 1 Open tables: 60 Queries per second avg: 4.860 Array ( [0] => Uptime: 1095822 [1] => Threads: 5 [2] => Questions: 5326101 [3] => Slow queries: 0 [4] => Opens: 7352 [5] => Flush tables: 1 [6] => Open tables: 60 [7] => Queries per second avg: 4.860 ) The above code will print out a string and then attempt to create an array by exploding the string using a delimiter of two spaces (eg: " "). This should give you an array to work with, however, I'm just beginning to use this extension, so feel free to correct any errors discovered :) ---- Server IP: 209.41.74.194 Probable Submitter: 66.240.11.2 ---- Manual Page -- http://www.php.net/manual/en/mysqli.stat.php Edit -- https://master.php.net/note/edit/90630 Del: integrated -- https://master.php.net/note/delete/90630/integrated Del: useless -- https://master.php.net/note/delete/90630/useless Del: bad code -- https://master.php.net/note/delete/90630/bad+code Del: spam -- https://master.php.net/note/delete/90630/spam Del: non-english -- https://master.php.net/note/delete/90630/non-english Del: in docs -- https://master.php.net/note/delete/90630/in+docs Del: other reasons-- https://master.php.net/note/delete/90630 Reject -- https://master.php.net/note/reject/90630 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#154076) next »