Alguem Pode me dar uma ajuda, quando tento abrir o shop system no site aparece a seguinte mensagem "the mysql extension is deprecated and will be removed in the future use mysqli or pdo instead" ja tentei trocar a linha que da erro para mysqli_connect porém a pagina nem carrega.
código do functions
<?php
class shop {function connect(){
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());return $ots->getDBHandle();}function isInstalled(){require('config.php');
$con = mysql_connect($config['database']['host'], $config['database']['login'], $config['database']['password']);
mysql_select_db($config['database']['database'],$con);if(mysql_query("SELECT * FROM shop_offer,shop_history"))returntrue;elsereturnfalse;}function points($account){
$SQL = $this->connect();
$points = $SQL->query('SELECT premium_points FROM accounts WHERE name = "'.$account.'"')->fetch();return $points['premium_points'];}function getPlayerAccount($name){
$SQL = $this->connect();
$player = $SQL->query('SELECT account_id FROM players WHERE name = "'.$name.'"')->fetch();return $SQL->query('SELECT * from accounts WHERE id = '.$player['account_id'].'');}functionAddPremium($name,$days){
$SQL = $this->connect();
$account = $this->getPlayerAccount($name)->fetch();return $SQL->query('UPDATE accounts SET premdays = (premdays + '.$days.') WHERE name = "'.$account['name'].'"');}functionCharacterList($account){
$SQL = $this->connect();
$id = $SQL->query('SELECT id FROM accounts WHERE name = "'.$account.'"')->fetch();return $SQL->query('SELECT * FROM players WHERE account_id = '.$id['id'].'');}function isOnline($name){
$SQL = $this->connect();
$player = $SQL->query('SELECT online FROM players WHERE name = "'.$name.'"')->fetch();return $player['online'];}function isBanned($name){
$SQL = $this->connect();
$ID = $this->getPlayerAccount($name)->fetch();return $SQL->query('SELECT * FROM bans WHERE value = '.$ID['id'].'');}functionUnBan($name){
$SQL = $this->connect();
$ID = $this->getPlayerAccount($name)->fetch();return $SQL->query('DELETE FROM bans WHERE value = '.$ID['id'].'');}function execute_file($file){if(!file_exists($file)){
$this->last_error ="The file $file does not exist.";returnfalse;}
$str = file_get_contents($file);if(!$str){
$this->last_error ="Unable to read the contents of $file.";returnfalse;}// split all the queries into an array
$quote ='';
$line ='';
$sql = array();
$ignoreNextChar ='';for($i =0; $i < strlen($str); $i++){if(!$ignoreNextChar ){
$char = substr($str, $i,1);
$line .= $char;if($char ==';'&& $quote ==''){
$sql[]= $line;
$line ='';}elseif( $char =='\\'){// Escape char; ignore the next char in the string
$ignoreNextChar = TRUE;}elseif($char =='"'|| $char =="'"|| $char =='`'){if( $quote =='')// Start of a new quoted string; ends with same quote char
$quote = $char;elseif( $char == $quote )// Current char matches quote char; quoted string ends
$quote ='';}}else
$ignoreNextChar = FALSE;}if($quote !='')returnfalse;foreach($sql as $query){if(!empty($query)){
$r = mysql_query($query);if(!$r){
$this->last_error = mysql_error();returnfalse;}}}returntrue;}function install(){
$SQL = $this->connect();if($this->isInstalled())returnfalse;elsereturn $this->execute_file("Shop System/config/Shop.sql");}}?>
Pergunta
caique8921 0
Alguem Pode me dar uma ajuda, quando tento abrir o shop system no site aparece a seguinte mensagem "the mysql extension is deprecated and will be removed in the future use mysqli or pdo instead" ja tentei trocar a linha que da erro para mysqli_connect porém a pagina nem carrega.
código do functions
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados