Read database connection from config file
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user