mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-11 23:26:08 +00:00
Trying to fix this monstrosity #1
This commit is contained in:
@@ -17,39 +17,5 @@ class MYSQLi_DB {
|
||||
return mysqli_query($this->connection, $query);
|
||||
}
|
||||
};
|
||||
class MYSQL_DB {
|
||||
var $connection;
|
||||
function MYSQL_DB() {
|
||||
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
|
||||
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
|
||||
}
|
||||
|
||||
function mysql_exec_batch ($p_query, $p_transaction_safe = true) {
|
||||
if ($p_transaction_safe) {
|
||||
$p_query = 'START TRANSACTION;' . $p_query . '; COMMIT;';
|
||||
};
|
||||
$query_split = preg_split ("/[;]+/", $p_query);
|
||||
foreach ($query_split as $command_line) {
|
||||
$command_line = trim($command_line);
|
||||
if ($command_line != '') {
|
||||
$query_result = mysql_query($command_line);
|
||||
if ($query_result == 0) {
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
return $query_result;
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
return mysql_query($query, $this->connection);
|
||||
}
|
||||
};
|
||||
|
||||
if(DB_TYPE) {
|
||||
$database = new MYSQLi_DB;
|
||||
}
|
||||
else {
|
||||
$database = new MYSQL_DB;
|
||||
}
|
||||
$database = new MYSQLi_DB;
|
||||
?>
|
||||
|
||||
@@ -6,12 +6,12 @@ $gameinstall = 1;
|
||||
include ("../../GameEngine/Admin/database.php");
|
||||
include ("../../GameEngine/Lang/" . LANG . ".php");
|
||||
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysqli_select_db(SQL_DB);
|
||||
|
||||
if(isset($_POST['mhpw'])) {
|
||||
$password = $_POST['mhpw'];
|
||||
mysql_query("UPDATE " . TB_PREFIX . "users SET password = '" . md5($password) . "' WHERE username = 'Multihunter'");
|
||||
mysqli_query("UPDATE " . TB_PREFIX . "users SET password = '" . md5($password) . "' WHERE username = 'Multihunter'");
|
||||
$wid = $admin->getWref(0, 0);
|
||||
$uid = 5;
|
||||
$status = $database->getVillageState($wid);
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
include ("../../GameEngine/Admin/database.php");
|
||||
|
||||
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysqli_select_db(SQL_DB);
|
||||
|
||||
$database->populateOasisdata();
|
||||
$database->populateOasis();
|
||||
|
||||
Reference in New Issue
Block a user