Little2Epic again. Another error. :/

dsktopx1

New Member
Messages
8
Reaction score
0
Points
1
Screenshot_2015-06-09-22-58-22.pngThis time Idk.....



Here's the code from the file causing error:
<?php
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) exit('No direct access allowed.');

/*****************************************************************
* Advanced Membership System *
* Copyright (c) 2012 MasDyn Studio, All Rights Reserved. *
*****************************************************************/

class MySQLDatabase {

private $connection;
public $last_query;
private $magic_quotes_active;
private $real_escape_string_exists;

function __construct() {
$this->open_connection();
$this->magic_quotes_active = get_magic_quotes_gpc();
$this->real_escape_string_exists = function_exists( "mysql_real_escape_string" );
}

public function open_connection() {
$this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
if (!$this->connection) {
die("Database connection failed: " . mysql_error());
} else {
$db_select = mysql_select_db(DB_NAME, $this->connection);
if (!$db_select) {
die("Database selection failed: " . mysql_error());
}
}
}

public function close_connection() {
if(isset($this->connection)) {
mysql_close($this->connection);
unset($this->connection);
}
}

public function query($sql) {
$this->last_query = $sql;
$result = mysql_query($sql, $this->connection);
$this->confirm_query($result);
return $result;
}

public function escape_value( $value ) {
if( $this->real_escape_string_exists ) { // PHP v4.3.0 or higher
// undo any magic quote effects so mysql_real_escape_string can do the work
if( $this->magic_quotes_active ) { $value = stripslashes( $value ); }
$value = mysql_real_escape_string( $value );
} else { // before PHP v4.3.0
// if magic quotes aren't already on then add slashes manually
if( !$this->magic_quotes_active ) { $value = addslashes( $value ); }
// if magic quotes are active, then the slashes already exist
}
return $value;
}

// "database-neutral" methods
public function fetch_array($result_set) {
return mysql_fetch_array($result_set);
}

public function num_rows($result_set) {
return mysql_num_rows($result_set);
}
public function insert_id() {
// get the last id inserted over the current db connection
return mysql_insert_id($this->connection);
}
public function affected_rows() {
return mysql_affected_rows($this->connection);
}

private function confirm_query($result) {
if (!$result) {
$output = "Database query failed: " . mysql_error() . "<br /><br />";
$output .= "Last SQL query: " . $this->last_query;
die( $output );
}
}

}

$database = new MySQLDatabase();
$db =& $database;

?>
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

This error message is being caused because your script is using the mysql_ PHP library, which is deprecated. While it is recommended that your script uses a supported method of connecting to MySQL, such as PDO or MySQLi, the error message will not affect your script. You can hide the error message using the error_reporting() tag, or by changing your PHP settings in cPanel. ;)

Thank you,
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

In your PHP script, you could use the line below to change the error reporting.
PHP:
error_reporting(E_ALL & ~E_DEPRECATED);


If you are not sure where to put this, it might be best to just disable error reporting for your account. To do this, please go to "Select PHP Version", and then "Switch to PHP Settings". Then, change "display_errors" to "Off", and click Apply. ;)

Thank you,
 
Top