diff options
| author | Andrew Dolgov <fox@bah.spb.su> | 2005-09-14 14:40:26 +0100 |
|---|---|---|
| committer | Andrew Dolgov <fox@bah.spb.su> | 2005-09-14 14:40:26 +0100 |
| commit | 5136011ee70823587a4f18fb79329a299d071ffe (patch) | |
| tree | afe6eaff3189ded933541f26a533276f512f2c05 | |
| parent | 387e6b413a6d1ab19f0ec645f89d9366ed80da64 (diff) | |
call mysql_error() on failed connection
| -rw-r--r-- | backend.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/backend.php b/backend.php index aaf4e9850..b5de559c9 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'"); } |