projects
/
e-DoKo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e50d24
)
NEW FEATURE: better debugging and optimization code for db-queries.
author
Arun Persaud
<arun@nubati.net>
Wed, 25 Feb 2009 04:26:08 +0000
(20:26 -0800)
committer
Arun Persaud
<arun@nubati.net>
Wed, 25 Feb 2009 04:26:08 +0000
(20:26 -0800)
added a timer to db_query for debugging/optimizatin
include/db.php
patch
|
blob
|
history
diff --git
a/include/db.php
b/include/db.php
index 28100a7b8d80b7fbec0493548db5c5738437e1c8..b84a56670c329c3dfb6ef1c16bcaab19f02ada7c 100644
(file)
--- 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);
}