local edits
This commit is contained in:
parent
3ab7aeb19e
commit
ea75fef77b
10 changed files with 136 additions and 44 deletions
|
|
@ -55,12 +55,12 @@ function mods($dbname) {
|
|||
}
|
||||
|
||||
function dbConnect($dbname){
|
||||
$servername = "localhost";
|
||||
$username = "localuser";
|
||||
$password = "Pkloyn7yvpht!";
|
||||
// Create connection
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
if (!$conn) {die("Connection failed: " . mysqli_connect_error());}
|
||||
$config = __DIR__ . '/../../includes/config.inc.php';
|
||||
if (!file_exists($config)) { die("Database configuration not found."); }
|
||||
require_once $config; // sets $db_host, $db_user, $db_pass
|
||||
// Create connection — $dbname parameter overrides the DB name from config
|
||||
$conn = new mysqli($db_host, $db_user, $db_pass, $dbname);
|
||||
if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }
|
||||
return $conn;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue