Welcome, Guest. Please login or register.

Author Topic: eroare mysql  (Read 1049 times)

0 Members and 1 Guest are viewing this topic.

Offline 24monden

  • Full Member
  • ***
  • Posts: 377
  • Reputation: +38/-45
    • View Profile
    • Stiri Mondene
eroare mysql
« on: April 26, 2016, 04:03:59 PM »
Deprecated[/size]: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in [/size]/home/smartmobitel/public_html/system/database/mysql.php[/size] on line [/size]6[/size]Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/smartmobitel/public_html/system/database/mysql.php:6) in /home/smartmobitel/public_html/system/library/session.phpon line 12Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/smartmobitel/public_html/system/database/mysql.php:6) in/home/smartmobitel/public_html/system/library/session.php on line 12Warning: Cannot modify header information - headers already sent by (output started at /home/smartmobitel/public_html/system/database/mysql.php:6) in/home/smartmobitel/public_html/index.php on line 179Warning: Cannot modify header information - headers already sent by (output started at /home/smartmobitel/public_html/system/database/mysql.php:6) in/home/smartmobitel/public_html/system/library/currency.php on line 45


eroare este afisata pe site-ul http://smartmobitel.ro/

Cine stie cum se poate rezolva ?

Multumesc.

ArenaWeb

eroare mysql
« on: April 26, 2016, 04:03:59 PM »

Offline dj_cata

  • Newbie
  • *
  • Posts: 35
  • Reputation: +4/-3
    • View Profile
    • Filme Online
Re: eroare mysql
« Reply #1 on: April 26, 2016, 05:29:00 PM »
modifica in fisierul mysql.php mysql cu mysqli, adauga un i defapt, si ar trebui sa iti mearga

Offline donleona

  • Newbie
  • *
  • Posts: 64
  • Reputation: +5/-2
  • Gender: Male
    • View Profile
    • Leona Management
Re: eroare mysql
« Reply #2 on: April 26, 2016, 05:48:28 PM »
S-ar putea sa nu ii mai mearga alte lucruri dupa aceea. In primul rand, incearca sa gasesti fisierul de setari open chart si sa pui debug pe OFF (false). Astfel, site-ul nu iti va mai afisa erorile php pentru moment.


Apoi incearca sa vezi daca reusesti sa faci update la tema folosita. Eroarea pare sa fie din cauza ca tema folosita are niste functii pe care creatorii scriptului (open chart) le-au eliminat (deprecated). Cu siguranta, facand update atat la script cat si la tema, vei rezolva problema.


Spor.
Prin natura ei, viata nu poate să dea garanţii, pentru că aceasta ar contracara Óntregul ei scop.

Offline gogule

  • Hostimm.com
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6269
  • Reputation: +1006/-306
  • Gender: Male
  • Daca iti este lene, atunci plateste.
    • View Profile
    • Immdomain
Re: eroare mysql
« Reply #3 on: April 27, 2016, 12:51:40 AM »
Daca ai posibilitatea la host sa schimbi versiunea php atunci treci la 5.3 sau 5.4. Apare eroare din cauza ca scriptul e facut sa functioneaza pe versiune mai veche de php.
Pentru a elimina eroare e nevoie de acces la php.ini. Pe unele hosturi merge si prin htaccess dar nu mereu.

O alta solutie este aici: http://stackoverflow.com/questions/21797118/deprecated-mysql-connect

Offline 24monden

  • Full Member
  • ***
  • Posts: 377
  • Reputation: +38/-45
    • View Profile
    • Stiri Mondene
Re: eroare mysql
« Reply #4 on: April 27, 2016, 11:37:24 AM »
ideea este ca nu ma pot loga la admin, ii dau logare si imi ramane doar eroarea aceea.


unde sa pun i-ul acela:



<?php
final class DBMySQL {
   private $link;


   public function __construct($hostname, $username, $password, $database) {
      if (!$this->link = mysql_connect($hostname, $username, $password)) {
         trigger_error('Error: Could not make a database link using ' . $username . '@' . $hostname);
      }


      if (!mysql_select_db($database, $this->link)) {
         trigger_error('Error: Could not connect to database ' . $database);
      }


      mysql_query("SET NAMES 'utf8'", $this->link);
      mysql_query("SET CHARACTER SET utf8", $this->link);
      mysql_query("SET CHARACTER_SET_CONNECTION=utf8", $this->link);
      mysql_query("SET SQL_MODE = ''", $this->link);
   }


   public function query($sql) {
      if ($this->link) {
         $resource = mysql_query($sql, $this->link);


         if ($resource) {
            if (is_resource($resource)) {
               $i = 0;


               $data = array();


               while ($result = mysql_fetch_assoc($resource)) {
                  $data[$i] = $result;


                  $i++;
               }


               mysql_free_result($resource);


               $query = new stdClass();
               $query->row = isset($data[0]) ? $data[0] : array();
               $query->rows = $data;
               $query->num_rows = $i;


               unset($data);


               return $query;   
            } else {
               return true;
            }
         } else {
            trigger_error('Error: ' . mysql_error($this->link) . '<br />Error No: ' . mysql_errno($this->link) . '<br />' . $sql);
            exit();
         }
      }
   }


   public function escape($value) {
      if ($this->link) {
         return mysql_real_escape_string($value, $this->link);
      }
   }


   public function countAffected() {
      if ($this->link) {
         return mysql_affected_rows($this->link);
      }
   }


   public function getLastId() {
      if ($this->link) {
         return mysql_insert_id($this->link);
      }
   }


   public function __destruct() {
      if ($this->link) {
         mysql_close($this->link);
      }
   }
}
?>

Offline gogule

  • Hostimm.com
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6269
  • Reputation: +1006/-306
  • Gender: Male
  • Daca iti este lene, atunci plateste.
    • View Profile
    • Immdomain
Re: eroare mysql
« Reply #5 on: April 27, 2016, 03:27:57 PM »
Se pare ca m-am obosit degeaba sa postez ca nici nu ai bagat de seama. Care desigur iti rezolva problema.
Cu placere.

Offline 24monden

  • Full Member
  • ***
  • Posts: 377
  • Reputation: +38/-45
    • View Profile
    • Stiri Mondene
Re: eroare mysql
« Reply #6 on: April 28, 2016, 10:28:54 AM »
salut, i-am dat off in php.ini insa tot apare eroarea:



magic_quotes_gpc = Off;
register_globals = Off;
default_charset   = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.use_only_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 172800;
allow_url_fopen = on;
;display_errors = 0;
;error_reporting = off;