From: Andrew Dolgov Date: Wed, 14 Sep 2005 13:40:26 +0000 (+0100) Subject: call mysql_error() on failed connection X-Git-Tag: 1.0.5~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5136011ee70823587a4f18fb79329a299d071ffe;p=tt-rss.git call mysql_error() on failed connection --- diff --git a/backend.php b/backend.php index aaf4e985..b5de559c 100644 --- a/backend.php +++ b/backend.php @@ -12,6 +12,14 @@ $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'"); }