Re: Re: PEAR:DB - How to count the queries times?
| From: | Yavor Shahpasov | Date: | Wed, 14 Apr 2004 11:01:32 +0000 |
| Subject: | Re: Re: PEAR:DB - How to count the queries times? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-27627@lists.php.net to get a copy of this message | ||
I was working on a class to analyze queries with PEAR::db
is far from complete but you could find it usefull for what you want to do.
you would have to pass a db object to the constructor, you can then use it as a normal PEAR::db object, you would need Console/Table for the text mode & overload extension for PHP4 or PHP5, html mode is not implemented
$real_db = DB::connect();
$db = new DB_Analyzer($real_db);
// app logic
$db->displayQueryStats('text');
// print all queries
print_r($db->stats);
This assumes of cource you use a single $db object in your app
Regards,
yavor
Aidan Lister wrote:
you can't "aî¿" <postmaster@openphp.cn> wrote in message news:php.pear.dev-27513@news.php.net...Hello, Everyone~~ I wan't to count how many DB queries in one request , how can I do? And How can I get all queries' strings which have run? Thanks everyone .. ShenKong ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡postmaster@openphp.cn ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2004-04-13