]> git.wh0rd.org - tt-rss.git/blobdiff - db.php
debug window look tweaks
[tt-rss.git] / db.php
diff --git a/db.php b/db.php
index e4673f679c4ed476531ee76ef93c08f73a981ab8..55768f3f66364909b06eb06d346a20138c863e59 100644 (file)
--- a/db.php
+++ b/db.php
@@ -5,12 +5,16 @@ require_once "config.php";
 function db_connect($host, $user, $pass, $db) {
        if (DB_TYPE == "pgsql") {       
                          
-               $string = "dbname=$db user=$user password=$pass";
+               $string = "dbname=$db user=$user password=$pass";       
                
                if ($host) {
                        $string .= " host=$host";
                }
 
+               if (defined('DB_PORT')) {
+                       $string = "$string port=" . DB_PORT;
+               }
+
                $link = pg_connect($string);
 
                if (!$link) {
@@ -118,3 +122,12 @@ function db_close($link) {
                return mysql_close($link);
        }
 }
+
+function db_affected_rows($link, $result) {
+       if (DB_TYPE == "pgsql") {
+               return pg_affected_rows($result);
+       } else if (DB_TYPE == "mysql") {
+               return mysql_affected_rows($link);
+       }
+}
+?>