Posiadam w plikach przestarzałe funkcję i nie jestem w stanie tego ogarnąć, jest ktoś w stanie pomóc? Tu jest jeden z plików:
Mam wersję PHP 5.6
Szukam pilnie odpłatnej pomocy. Kontakt pw, albo discord: NeXt#3957
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * Description of session * * @author Maxime */ require_once("config.inc.php"); //$db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); ################################################################################
################### ################################################################################
################### ################################################################################
################### class Database { var $server = ""; //database server var $user = ""; //database login name var $pass = ""; //database login password var $database = ""; //database name var $pre = ""; //table prefix ####################### //internal info var $error = ""; var $errno = 0; //number of rows affected by SQL query var $affected_rows = 0; var $link_id = 0; var $query_id = 0; #-############################################# # desc: constructor function Database($database) { $this->server = DB_FORUMS_SERVER; $this->user = DB_FORUMS_USER; $this->pass = DB_FORUMS_PASS; $this->database = DB_FORUMS_DATABASE; $this->server = DB_LOGS_SERVER; $this->user = DB_LOGS_USER; $this->pass = DB_LOGS_PASS; $this->database = DB_LOGS_DATABASE; $this->server = DB_SERVER; $this->user = DB_USER; $this->pass = DB_PASS; $this->database = DB_DATABASE; } } #-#constructor() #-############################################# # desc: connect and select database using vars above # Param: $new_link can force connect() to open a new link, even if mysql_connect() was called before with the same parameters function affected_rows(){ return $this->affected_rows; } function connect($new_link = false) { if (!$this->link_id) {//open failed $this->oops("Could not connect to server: <b>$this->server</b>."); } $this->oops("Could not open database: <b>$this->database</b>."); } // unset the data so it can't be dumped $this->server = ''; $this->user = ''; $this->pass = ''; $this->database = ''; } #-#connect() #-############################################# # desc: close the connection function close() { $this->oops("Connection close failed."); } } #-#close() #-############################################# # Desc: escapes characters to be mysql ready # Param: string # returns: string function escape($string) { } #-#escape() #-############################################# # Desc: executes SQL query to an open connection # Param: (MySQL query) to execute # returns: (query_id) for fetching results etc function query($sql) { // do query if (!$this->query_id) { $this->oops("<b>MySQL Query fail:</b> $sql"); return 0; } return $this->query_id; } #-#query() #-############################################# # desc: fetches and returns results one line at a time # param: query_id for mysql run. if none specified, last used # return: (array) fetched record(s) function fetch_array($query_id = -1) { // retrieve row if ($query_id != -1) { $this->query_id = $query_id; } } else { $this->oops("Invalid query_id: <b>$this->query_id</b>. Records could not be fetched."); } return $record; } #-#fetch_array() #-############################################# # desc: returns all the results (not one row) # param: (MySQL query) the query to run on server # returns: assoc array of ALL fetched results function fetch_all_array($sql) { $query_id = $this->query($sql); while ($row = $this->fetch_array($query_id)) { $out[] = $row; } $this->free_result($query_id); return $out; } #-#fetch_all_array() #-############################################# # desc: frees the resultset # param: query_id for mysql run. if none specified, last used function free_result($query_id = -1) { if ($query_id != -1) { $this->query_id = $query_id; } $this->oops("Result ID: <b>$this->query_id</b> could not be freed."); } } #-#free_result() #-############################################# # desc: does a query, fetches the first row only, frees resultset # param: (MySQL query) the query to run on server # returns: array of fetched results function query_first($query_string) { $query_id = $this->query($query_string); $out = $this->fetch_array($query_id); $this->free_result($query_id); return $out; } #-#query_first() #-############################################# # desc: does an update query with an array # param: table (no prefix), assoc array with data (doesn't need escaped), where condition # returns: (query_id) for fetching results etc function query_update($table, $data, $where = '1') { $q = "UPDATE `" . $this->pre . $table . "` SET "; foreach ($data as $key => $val) { $q.= "`$key` = NULL, "; $q.= "`$key` = NOW(), "; $q.= "`$key` = `$key` + $m[1], "; else $q.= "`$key`='" . $this->escape($val) . "', "; } return $this->query($q); } #-#query_update() #-############################################# # desc: does an insert query with an array # param: table (no prefix), assoc array with data # returns: id of inserted record, false if error function query_insert($table, $data) { $q = "INSERT INTO `" . $this->pre . $table . "` "; $v = ''; $n = ''; foreach ($data as $key => $val) { $n.="`$key`, "; $v.="NULL, "; $v.="NOW(), "; else $v.= "'" . $this->escape($val) . "', "; } if ($this->query($q)) { //$this->free_result(); } else return false; } #-#query_insert() #-############################################# # desc: throw an error message # param: [optional] any custom error to display function oops($msg = '') { if ($this->link_id > 0 and $this->link_id != 5) { } else { } ?> <table align="center" border="1" cellspacing="0" style="background:white;color:black;width:80%;"> <tr><th colspan=2>Database Error</th></tr> </table> <?php } #-#oops() } //CLASS Database ################################################################################
################### ?>