Welcome Guest, Not a member yet? Register   Sign In
Need help with Cyrillic
#1

click send knocks this out:
PHP Code:
A Database Error Occurred
Error Number
1366

Incorrect string value
'\xD0, \xD0, ...' for column 'actors' at row 1

INSERT INTO 
`video` (`actors`, `type`, `title`, `title_en`, `description`, `duration`, `thumbnail`, `countries`, `year`, `genre`, `translator`, `embed_url`, `category_id`, `date`) VALUES ('�, �, �, �, �, �, �, �, �, �''vimeo''Обитель тьмы Гарта Маренги''Garth Marenghi\'s Darkplace''Пародия на телевизионные хоррор-шоу 80-х (дешёвое производство, ужасные диалоги, комическое насилие). События происходят в больнице в Ромфорде, расположенной на воротах в ад.'22'https://st.kp.yandex.net/images/film_iphone/iphone360_471995.jpg''Великобритания'2004'ужасы''Проф. Одноголосый''//kodik.info/serial/14257/ba35b673de10ac170145bacc091c7178/720p''1''05 Aug, 2019')

FilenameC:\Users\snup\Downloads\OSPanel\domains\serialturk.ga\system\database\DB_driver.php

Line Number
330 

already googled about half the Internet can't solve a problem with the Cyrillic alphabet

PHP Code:
{
 
 "time""1ms",
 
 "total"3,
 
 "results": [],
 
 "": {
 
   "id""serial-17693",
 
   "type""foreign-serial",
 
   "link""//kodik.info/serial/17693/25c2955ee8f0502e1ca2906f78aa1b9a/720p",
 
   "title""Тёмная сеть",
 
   "title_orig""Dark/Web",
 
   "translation": {
 
     "id"920,
 
     "title""Octopus"
 
   },
 
   "year"2019,
 
   "last_season"1,
 
   "last_episode"8,
 
   "episodes_count"8,
 
   "kinopoisk_id""1008788",
 
   "imdb_id""tt5600406",
 
   "quality""WEB-DLRip",
 
   "camrip"false,
 
   "blocked_countries": [],
 
   "blocked_seasons": {},
 
   "created_at""2019-07-22T03:18:03Z",
 
   "updated_at""2019-07-22T03:18:03Z",
 
   "material_data": {
 
     "title""Тёмная сеть",
 
     "title_en""Dark/Web",
 
     "year"2019,
 
     "poster_url""https://st.kp.yandex.net/images/film_iphone/iphone360_1008788.jpg",
 
     "countries": [
 
       "США"
 
     ],
 
     "genres": [
 
       "ужасы"
 
     ],
 
     "kinopoisk_votes"29,
 
     "imdb_rating"5.2,
 
     "imdb_votes"189,
 
     "premiere_world""2019-02-08",
 
     "actors": [
 
       "Брайан Элердинг",
 
       "Лана МакКиссак",
 
       "Майкл Нарделли",
 
       "Сибонгиле Мламбо",
 
       "Ноеми Гонзалез",
 
       "Рене Хегер",
 
       "Роб Раш",
 
       "Айми МакКэй",
 
       "Эмилио Россал",
 
       "Николас Брендон"
 
     ],
 
     "directors": [
 
       "Рокси Ших",
 
       "Марио Мисионе",
 
       "Боман Модин"
 
     ],
 
     "producers": [
 
       "Марио Мисионе",
 
       "Майкл Нарделли",
 
       "Тим Нарделли"
 
     ],
 
     "writers": [
 
       "Марио Мисионе",
 
       "Боман Модин",
 
       "Майкл Нарделли"
 
     ],
 
     "composers": [
 
       "Джонатан Хартман",
 
       "Нуну Малу",
 
       "Роб Гоки"
 
     ],
 
     "editors": [
 
       "Йен Пэкстон"
 
     ],
 
     "designers": [
 
       "Роберт Уайз",
 
       "Трэйси Хэйс",
 
       "Аннинка Велье"
 
     ],
 
     "operators": [
 
       "Ларс Линдстрём",
 
       "Шелдон Чау",
 
       "Аллен И. Хо"
 
     ]
 
   }
 
 },
 
 " (copy)": {
 
   "id""serial-17922",
 
   "type""foreign-serial",
 
   "link""//kodik.info/serial/17922/8d7e152a3b09eb130f7150bbc554a2a0/720p",
 
   "title""Тёмная сеть",
 
   "title_orig""Dark/Web",
 
   "translation": {
 
     "id"879,
 
     "title""TVShows"
 
   },
 
   "year"2019,
 
   "last_season"1,
 
   "last_episode"8,
 
   "episodes_count"8,
 
   "kinopoisk_id""1008788",
 
   "imdb_id""tt5600406",
 
   "quality""WEB-DLRip 1080p",
 
   "camrip"false,
 
   "blocked_countries": [],
 
   "blocked_seasons": {},
 
   "created_at""2019-08-05T00:25:25Z",
 
   "updated_at""2019-08-05T00:25:25Z",
 
   "material_data": {
 
     "title""Тёмная сеть",
 
     "title_en""Dark/Web",
 
     "year"2019,
 
     "poster_url""https://st.kp.yandex.net/images/film_iphone/iphone360_1008788.jpg",
 
     "countries": [
 
       "США"
 
     ],
 
     "genres": [
 
       "ужасы"
 
     ],
 
     "kinopoisk_votes"29,
 
     "imdb_rating"5.2,
 
     "imdb_votes"189,
 
     "premiere_world""2019-02-08",
 
     "actors": [
 
       "Брайан Элердинг",
 
       "Лана МакКиссак",
 
       "Майкл Нарделли",
 
       "Сибонгиле Мламбо",
 
       "Ноеми Гонзалез",
 
       "Рене Хегер",
 
       "Роб Раш",
 
       "Айми МакКэй",
 
       "Эмилио Россал",
 
       "Николас Брендон"
 
     ],
 
     "directors": [
 
       "Рокси Ших",
 
       "Марио Мисионе",
 
       "Боман Модин"
 
     ],
 
     "producers": [
 
       "Марио Мисионе",
 
       "Майкл Нарделли",
 
       "Тим Нарделли"
 
     ],
 
     "writers": [
 
       "Марио Мисионе",
 
       "Боман Модин",
 
       "Майкл Нарделли"
 
     ],
 
     "composers": [
 
       "Джонатан Хартман",
 
       "Нуну Малу",
 
       "Роб Гоки"
 
     ],
 
     "editors": [
 
       "Йен Пэкстон"
 
     ],
 
     "designers": [
 
       "Роберт Уайз",
 
       "Трэйси Хэйс",
 
       "Аннинка Велье"
 
     ],
 
     "operators": [
 
       "Ларс Линдстрём",
 
       "Шелдон Чау",
 
       "Аллен И. Хо"
 
     ]
 
   }
 
 },
 
 " (copy 2)": {
 
   "id""serial-17678",
 
   "type""foreign-serial",
 
   "link""//kodik.info/serial/17678/58647da25ae15b7ec12b88239a23509c/720p",
 
   "title""Тёмная сеть",
 
   "title_orig""Dark/Web",
 
   "translation": {
 
     "id"794,
 
     "title""HDrezka Studio"
 
   },
 
   "year"2019,
 
   "last_season"1,
 
   "last_episode"8,
 
   "episodes_count"8,
 
   "kinopoisk_id""1008788",
 
   "imdb_id""tt5600406",
 
   "quality""WEB-DLRip 1080p",
 
   "camrip"false,
 
   "blocked_countries": [],
 
   "blocked_seasons": {},
 
   "created_at""2019-07-21T09:29:51Z",
 
   "updated_at""2019-07-23T09:35:17Z",
 
   "material_data": {
 
     "title""Тёмная сеть",
 
     "title_en""Dark/Web",
 
     "year"2019,
 
     "poster_url""https://st.kp.yandex.net/images/film_iphone/iphone360_1008788.jpg",
 
     "countries": [
 
       "США"
 
     ],
 
     "genres": [
 
       "ужасы"
 
     ],
 
     "kinopoisk_votes"29,
 
     "imdb_rating"5.2,
 
     "imdb_votes"189,
 
     "premiere_world""2019-02-08",
 
     "actors": [
 
       "Брайан Элердинг",
 
       "Лана МакКиссак",
 
       "Майкл Нарделли",
 
       "Сибонгиле Мламбо",
 
       "Ноеми Гонзалез",
 
       "Рене Хегер",
 
       "Роб Раш",
 
       "Айми МакКэй",
 
       "Эмилио Россал",
 
       "Николас Брендон"
 
     ],
 
     "directors": [
 
       "Рокси Ших",
 
       "Марио Мисионе",
 
       "Боман Модин"
 
     ],
 
     "producers": [
 
       "Марио Мисионе",
 
       "Майкл Нарделли",
 
       "Тим Нарделли"
 
     ],
 
     "writers": [
 
       "Марио Мисионе",
 
       "Боман Модин",
 
       "Майкл Нарделли"
 
     ],
 
     "composers": [
 
       "Джонатан Хартман",
 
       "Нуну Малу",
 
       "Роб Гоки"
 
     ],
 
     "editors": [
 
       "Йен Пэкстон"
 
     ],
 
     "designers": [
 
       "Роберт Уайз",
 
       "Трэйси Хэйс",
 
       "Аннинка Велье"
 
     ],
 
     "operators": [
 
       "Ларс Линдстрём",
 
       "Шелдон Чау",
 
       "Аллен И. Хо"
 
     ]
 
   }
 
 }


PHP Code:
    function add_vimeo_video()
    {
        
$urls            =    $this->input->post('url');
        
$number_of_url    =    $urls;                
        
$response json_decode(file_get_contents('https://kodikapi.com/search?token="MY-TOKEN"&kinopoisk_id='.$number_of_url.'&with_material_data=true',false), true);
        
//$response = json_decode( $curl, true );
        
        
$arr $response['results'][0]['material_data']['actors'];
        
        
$actors = array(); 
        foreach (
$arr as $key => $value) {
            
$actors[] = $value['actors'];
            
        }
        
$data['actors'        implode(", "$actors);
        
//var_dump($data['actors']); exit;
        //$data['actors']         =    $response['results'][0]['material_data']['actors'][0];
        
$data['type'             'vimeo';
        
$data['title'            $response['results'][0]['material_data']['title'];
        
$data['title_en'         $response['results'][0]['material_data']['title_en'];
        
$data['description'      $response['results'][0]['material_data']['description'];
        
$data['duration'         $response['results'][0]['material_data']['duration'];
        
$data['thumbnail'        $response['results'][0]['material_data']['poster_url'];
        
$data['countries'        $response['results'][0]['material_data']['countries'][0];
        
$data['year'             $response['results'][0]["year"];
        
$data['genre'            $response['results'][0]['material_data']["genres"][0];
        
//$data['director']       =    $response['results'][0]['material_data']['directors'];
        
$data['translator'       $response['results'][0]["translation"]['title'];
        
$data['embed_url'        $response['results'][0]['link'];
        
$data['category_id']    =    $this->input->post('category_id');
        
$data['date'              date("d M, Y");
        
$this->db->insert('video' $data);
    } 
Reply
#2

(This post was last modified: 08-06-2019, 09:57 PM by Avega Soft.)

Check charset from file_get_contents link.

Code:
$file = file_get_contents($x);
$encod = mb_convert_encoding($file, 'UTF-8');
Reply
#3

(08-05-2019, 07:56 PM)Avega Soft *REDACTED* Wrote:
Code:
$file = file_get_contents($x);
$encod = mb_convert_encoding($file, 'UTF-8');

English, please!
Reply
#4

(08-05-2019, 08:56 PM)ciadmin Wrote:
(08-05-2019, 07:56 PM)Avega Soft *REDACTED* Wrote:
Code:
$file = file_get_contents($x);
$encod = mb_convert_encoding($file, 'UTF-8');

English, please!

Ok!)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB