call mysql_error() on failed connection

This commit is contained in:
Andrew Dolgov 2005-09-14 14:40:26 +01:00
parent 387e6b413a
commit 5136011ee7
1 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,14 @@
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $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") { if (DB_TYPE == "pgsql") {
pg_query("set client_encoding = 'utf-8'"); pg_query("set client_encoding = 'utf-8'");
} }