]> git.wh0rd.org Git - tt-rss.git/commitdiff
call mysql_error() on failed connection
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 14 Sep 2005 13:40:26 +0000 (14:40 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 14 Sep 2005 13:40:26 +0000 (14:40 +0100)
backend.php

index aaf4e98500726ec87d7b98608406e21cc25f672e..b5de559c957cb20faae5684a40bc9396367abbf7 100644 (file)
 
        $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
 
+       if (!$link) {
+               if (DB_TYPE == "mysql") {
+                       print mysql_error();
+               }
+               // PG seems to display its own errors just fine by default.             
+               return;
+       }
+
        if (DB_TYPE == "pgsql") {
                pg_query("set client_encoding = 'utf-8'");
        }