summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2009-02-24 20:26:08 -0800
committerArun Persaud <arun@nubati.net>2009-02-24 20:26:08 -0800
commitd68b2fa2ea0ef193ca1d9d906a8e8071dd191e77 (patch)
tree16aee392596c6d768f0dce07eeea7cda8f64b71b /include
parent8e50d2401a3379114bf58d9532589af0a5bae2ca (diff)
downloade-DoKo-d68b2fa2ea0ef193ca1d9d906a8e8071dd191e77.tar.gz
e-DoKo-d68b2fa2ea0ef193ca1d9d906a8e8071dd191e77.tar.bz2
e-DoKo-d68b2fa2ea0ef193ca1d9d906a8e8071dd191e77.zip
NEW FEATURE: better debugging and optimization code for db-queries.
added a timer to db_query for debugging/optimizatin
Diffstat (limited to 'include')
-rw-r--r--include/db.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/db.php b/include/db.php
index 28100a7..b84a566 100644
--- a/include/db.php
+++ b/include/db.php
@@ -61,8 +61,18 @@ function DB_query($query)
/* debug/optimize the database
$logfile=fopen('/tmp/DBlog.log','a+');
fwrite($logfile,"EXPLAIN $query ;\n");
+
+ $time = microtime();
+ $return = mysql_query($query);
+ $time = $time - microtime();
+
+ fwrite($logfile,"time of above query: $time\n");
+
fclose($logfile);
+
+ return $return;
*/
+
return mysql_query($query);
}