Trying to fix this monstrosity #1

This commit is contained in:
Domen Kajdič
2016-09-13 15:38:14 +02:00
parent 0e4b22d99f
commit 2cf2f3c343
22 changed files with 969 additions and 4733 deletions
+1 -35
View File
@@ -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;
?>