Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

database.php bug ! Help Please ! yi1234 Trafian T4

Status
Not open for further replies.
Newbie Spellweaver
Joined
Apr 24, 2012
Messages
8
Reaction score
0
PHP:
<?php

set_time_limit(0); 
date_default_timezone_set('Asia/Kolkata');
include("connection.php");
include("constant.php");

class MYSQLi_DB {
	
	var $connection;
	
	function MYSQLi_DB() {
		$this->connection = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB) or die(mysqli_error());
	}
		function query($query) {
		return $this->connection->query($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;
}
?>


BUG :

Fatal error: Cannot redeclare class MYSQLi_DB in /data/multiserv/users/870755/projects/2066153/www/install/include/database.php on line 8

Fatal error: Cannot redeclare class MYSQL_DB in /data/multiserv/users/870755/projects/2066153/www/install/include/database.php on line 21


HELP PLEASE BAD ENGLISH !
 
Status
Not open for further replies.
Back
Top