diff options
author | Arun Persaud <arun@nubati.net> | 2009-02-24 20:26:08 -0800 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2009-02-24 20:26:08 -0800 |
commit | d68b2fa2ea0ef193ca1d9d906a8e8071dd191e77 (patch) | |
tree | 16aee392596c6d768f0dce07eeea7cda8f64b71b | |
parent | 8e50d2401a3379114bf58d9532589af0a5bae2ca (diff) | |
download | e-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
-rw-r--r-- | include/db.php | 10 |
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); } |