summaryrefslogtreecommitdiffstats
path: root/lib/class/dba.class.php
diff options
context:
space:
mode:
authorPaul Arthur <flowerysong00@yahoo.com>2012-11-08 13:15:19 -0500
committerPaul Arthur <flowerysong00@yahoo.com>2012-11-08 13:15:19 -0500
commitd2eaf10b072f8cb1dca887af2006eba00a3fc0fa (patch)
treec66320acdac0981575825de02608b867b65fdb7f /lib/class/dba.class.php
parent0d78b77443481e3678d933c9590a4e2f7a4f90fa (diff)
downloadampache-d2eaf10b072f8cb1dca887af2006eba00a3fc0fa.tar.gz
ampache-d2eaf10b072f8cb1dca887af2006eba00a3fc0fa.tar.bz2
ampache-d2eaf10b072f8cb1dca887af2006eba00a3fc0fa.zip
Move check_database into the Dba class
Diffstat (limited to 'lib/class/dba.class.php')
-rw-r--r--lib/class/dba.class.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php
index 75735819..03bf441c 100644
--- a/lib/class/dba.class.php
+++ b/lib/class/dba.class.php
@@ -277,6 +277,26 @@ class Dba {
} // _connect
/**
+ * check_database
+ *
+ * Make sure that we can connect to the database
+ */
+ public static function check_database($host,$username,$pass) {
+
+ $dbh = @mysql_connect($host, $username, $pass);
+
+ if (!is_resource($dbh)) {
+ return false;
+ }
+ if (!$host || !$username) {
+ return false;
+ }
+
+ return $dbh;
+
+ } // check_database
+
+ /**
* show_profile
* This function is used for debug, helps with profiling
*/