summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-11-11 12:26:54 +0400
committerAndrew Dolgov <[email protected]>2011-11-11 12:26:54 +0400
commit0c543d46b34fc1542d37cd4b44b70d848eab0a27 (patch)
tree666e7b4e76627df74a45af2e8de62a3a85ffaf9c /db.php
parentafba49c39a737ddbf140d84af783bb642d71cea5 (diff)
add optional query log
Diffstat (limited to 'db.php')
-rw-r--r--db.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/db.php b/db.php
index 81da431b9..e886e51af 100644
--- a/db.php
+++ b/db.php
@@ -52,6 +52,10 @@ function db_escape_string($s, $strip_tags = true) {
}
function db_query($link, $query, $die_on_error = true) {
+ if ($_REQUEST["qlog"])
+ error_log($_SESSION["uid"] . ":" . $_REQUEST["op"] . "/" . $_REQUEST["subop"] .
+ " $query\n", 3, "/tmp/ttrss-query.log");
+
if (DB_TYPE == "pgsql") {
$result = pg_query($link, $query);
if (!$result) {