Read database connection from config file

This commit is contained in:
root
2019-02-27 17:39:20 +01:00
parent 1e0cec945c
commit 2040b7be39
5 changed files with 31 additions and 14 deletions

View File

@@ -23,6 +23,7 @@ require_once 'vendor/autoload.php';
die();
}
$cfg = include('accred_config.php');
$uname = $_SESSION['name'];
if($_POST['btncancel']) {
@@ -71,8 +72,8 @@ require_once 'vendor/autoload.php';
$mysqli = new mysqli($cfg['host'], $cfg['user'],$cfg['pass'], $cfg['name']);
$mysqli = new mysqli("localhost", "caribanaaccred", "welcome99", "caribanaaccred");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}