Hopefully this works, switching to the new way that the servers are used (not ported yet, just the newconnection() func was changed)

This commit is contained in:
Lncvrt committed 2025-12-31 16:55:10 -07:00
1 parent 12c5b431cb
commit 56f92948fa
2 files changed
+18 -7

No files matched your search

+10 -5
View File
@@ -1,6 +1,11 @@
<?php <?php
$db_host = "localhost"; $games_db_host = "localhost";
$db_port = 3306; $games_db_port = 3306;
$db_user = ""; $games_db_user = "";
$db_pass = ""; $games_db_pass = "";
$db_name = ""; $games_db_name = "";
$bd_db_host = "localhost";
$bd_db_port = 3306;
$bd_db_user = "";
$bd_db_pass = "";
$bd_db_name = "";
+8 -2
View File
@@ -11,10 +11,16 @@ function getIPAddress() {
return $_SERVER['HTTP_CF_CONNECTING_IP']; return $_SERVER['HTTP_CF_CONNECTING_IP'];
} }
function newConnection() { function newConnection($type = 1) {
include __DIR__.'/../config/connection.php'; include __DIR__.'/../config/connection.php';
try { try {
$conn = new mysqli($db_host, $db_user, $db_pass, $db_name, $db_port); $conn = new mysqli(
$type == 0 ? $games_db_host : $bd_db_host,
$type == 0 ? $games_db_user : $bd_db_user,
$type == 0 ? $games_db_pass : $bd_db_pass,
$type == 0 ? $games_db_name : $bd_db_name,
$type == 0 ? $games_db_port : $bd_db_port
);
} catch (mysqli_sql_exception $e) { } catch (mysqli_sql_exception $e) {
exitWithMessage("-999"); exitWithMessage("-999");
} }