andre 4 years ago
parent
commit
703e3c014f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      index.php

+ 1 - 1
index.php

@@ -12,6 +12,7 @@ class db {
         try
         try
         {
         {
             self::$db_obj = new mysqli($this->host, $this->user, $this->pw, $this->dbname);
             self::$db_obj = new mysqli($this->host, $this->user, $this->pw, $this->dbname);
+            self::$db_obj->set_charset('utf8');
         }
         }
         catch(Exception $e)
         catch(Exception $e)
         {
         {
@@ -36,7 +37,6 @@ $db = new db;
 if ($db->connect_errno){
 if ($db->connect_errno){
     die($db->connect_error);
     die($db->connect_error);
 }
 }
-$db->set_charset('utf8');
 
 
 function checkToken($token,$db) {
 function checkToken($token,$db) {
     $dbAction = $db->prepare("SELECT description FROM clients WHERE token = ?");
     $dbAction = $db->prepare("SELECT description FROM clients WHERE token = ?");