]> git.wh0rd.org - tt-rss.git/blobdiff - db.php
catchup in category view mode jumps to the next unread category
[tt-rss.git] / db.php
diff --git a/db.php b/db.php
index 7766c0563a8f27ccc2ba6284169f90961bd2a762..d8187fc3bcf65808bfe674d383fda7b19aec27d4 100644 (file)
--- a/db.php
+++ b/db.php
@@ -1,4 +1,4 @@
-<?
+<?php
 
 require_once "config.php";
 
@@ -61,7 +61,7 @@ function db_query($link, $query, $die_on_error = true) {
                if (!$result) {
                        $query = htmlspecialchars($query); // just in case
                        if ($die_on_error) {
-                               die("Query <i>$query</i> failed: " . pg_last_error($link));                     
+                               die("Query <i>$query</i> failed [$result]: " . pg_last_error($link));                   
                        }
                }
                return $result;
@@ -134,4 +134,13 @@ function db_affected_rows($link, $result) {
                return mysql_affected_rows($link);
        }
 }
+
+function db_last_error($link) {
+       if (DB_TYPE == "pgsql") {
+               return pg_last_error($link);
+       } else if (DB_TYPE == "mysql") {
+               return mysql_error($link);
+       }
+}
+
 ?>