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:
@@ -1,6 +1,11 @@
|
||||
<?php
|
||||
$db_host = "localhost";
|
||||
$db_port = 3306;
|
||||
$db_user = "";
|
||||
$db_pass = "";
|
||||
$db_name = "";
|
||||
$games_db_host = "localhost";
|
||||
$games_db_port = 3306;
|
||||
$games_db_user = "";
|
||||
$games_db_pass = "";
|
||||
$games_db_name = "";
|
||||
$bd_db_host = "localhost";
|
||||
$bd_db_port = 3306;
|
||||
$bd_db_user = "";
|
||||
$bd_db_pass = "";
|
||||
$bd_db_name = "";
|
||||
@@ -11,10 +11,16 @@ function getIPAddress() {
|
||||
return $_SERVER['HTTP_CF_CONNECTING_IP'];
|
||||
}
|
||||
|
||||
function newConnection() {
|
||||
function newConnection($type = 1) {
|
||||
include __DIR__.'/../config/connection.php';
|
||||
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) {
|
||||
exitWithMessage("-999");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user