diff options
Diffstat (limited to 'infra-dashboard/utils')
-rw-r--r-- | infra-dashboard/utils/database.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/infra-dashboard/utils/database.php b/infra-dashboard/utils/database.php index bacf363..b72c3d1 100644 --- a/infra-dashboard/utils/database.php +++ b/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."); } |