From 64d30a2bacc59f8a2c38c4998071e7bf9c942c2e Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Fri, 23 Dec 2011 22:04:24 +0100 Subject: Print out some performance information. Queries fired and execution time. --- ratatoeskr/sys/db.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ratatoeskr/sys/db.php') diff --git a/ratatoeskr/sys/db.php b/ratatoeskr/sys/db.php index e5caddc..cbf2100 100644 --- a/ratatoeskr/sys/db.php +++ b/ratatoeskr/sys/db.php @@ -76,6 +76,8 @@ function qdb_fmt() return qdb_vfmt(func_get_args()); } +$queries_fired = 0; + /* * Function: qdb * Query Database. @@ -89,10 +91,12 @@ function qdb_fmt() */ function qdb() { + global $queries_fired; $query = qdb_vfmt(func_get_args()); $rv = mysql_query($query); if($rv === false) throw new MySQLException(mysql_errno() . ': ' . mysql_error() . (__DEBUG__ ? ("[[FULL QUERY: " . $query . "]]") : "" )); + $queries_fired++; return $rv; } -- cgit v1.2.3-70-g09d2