0

возвращает

[{"name":"????? 10"},{"name":"????? 10"},{"name":"????? 10"},{"name":"????? 12"},{"name":"????? 12"},{"name":"????? 1"},{"name":"????? 27"},{"name":"????? 1"},{"name":"????? 27"},{"name":"????? 4"},{"name":"????? 4"},{"name":"????? 4"},{"name":"????? 4"},{"name":"????? 4"},{"name":"????? 4"},{"name":"????? 4"},{"name":"????? 10"},{"name":"????? 1"},{"name":"????? 2"},{"name":"????? 1"},{"name":"????? 2"},{"name":"????? 3"},{"name":"????? 4"},{"name":"????? 5"},{"name":"????? 6"},{"name":"????? 12"},{"name":"????? 12"},{"name":"????? 10"},{"name":"????? 10"},{"name":"????? 10"},{"name":"????? 9"},{"name":"??? ???"},{"name":"????? 6"},{"name":"????? 12"}]

возвращет хоть в phpmyadmin все нормально выводится 2 колонки код функции

public function conclusionData()
    {
        $this->_mysqli->query('utf8_general_ci');
        $result=NULL;
        $sql=$this->_mysqli->prepare("SELECT a.name,e.name FROM stat s JOIN episodes e on s.source_id=e.id JOIN anime a on e.anime_id=a.id");
      //  $sql->bind_param("i",$data);
        $status=$sql->execute();
        if($status){
            $result = $sql->get_result ();
            $returnArray=array ();
            $row  =  $result -> fetch_assoc ();
            while ($row) {
                $returnArray[] = $row ;
                $row  =  $result -> fetch_assoc ();
            }
            $result -> free ();
            return json_encode($returnArray);

        }

с кодировкой все нормально в бд выстовлена на всех 3 таблицах utf8_general_ci буду благодарен за любую помощь

2

1 ответ 1

0

была такая проблема после подключение к базе нужно выполнить запрос $this->_mysqli->query('SET NAMES utf8');

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.