diff options
Diffstat (limited to 'tools/infra-dashboard/utils/database.php')
-rw-r--r-- | tools/infra-dashboard/utils/database.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/infra-dashboard/utils/database.php b/tools/infra-dashboard/utils/database.php index bacf3637..b72c3d12 100644 --- a/tools/infra-dashboard/utils/database.php +++ b/tools/infra-dashboard/utils/database.php @@ -1,13 +1,15 @@ <?php - + include '../../../../auth-db.php'; date_default_timezone_set('UTC'); function connectDB() { - $username = "root"; - $password = "opnfv"; - $hostname = "localhost"; + global $username; + global $password; + global $hostname; + global $dbname; + $dbhandle = mysql_connect($hostname, $username, $password) - or die("Unable to connect to MySQL."); - $selected = mysql_select_db("opnfv_pharos",$dbhandle) + or die("Unable to connect to MySQL.".mysql_error()); + $selected = mysql_select_db($dbname,$dbhandle) or die("Could not select opnfv_pharos DB."); } |