如何在Codeigniter中显示泰米尔语内容形式的MySQL数据库

问题描述:

我在查看使用CodeIgniter从mysql数据库检索的泰米尔语内容时遇到问题。但相同的代码在核心php中工作。我在下面附上了我的代码。请检查我的代码并给出答案是否有任何更改。

I am having problem for viewing the Tamil content which retrive from mysql database using CodeIgniter. but the same code is working in core php. i have attached my code below. please check my code and give answer if any changes.

这是我的查看代码:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <table class="table table-striped table-bordered table-hover dataTables-example" >
                <thead>
                <tr>
                    <th>Title</th>
                    <th>Description</th>
                 </tr>
                </thead>
                 <tbody>
                          <?php

                               foreach ($per_results as $result)
                               {

                               ?>
    <tr class="">

                               <td><?php echo $result->title;?></td>
                               <td><?php echo $result->description;?></td>
   </tr>
    <?php
                               }
                               ?>

                          </tbody>

                </table>

这是我的控制器代码:

   public function view_mainhome()
    {
      $data['per_results'] = $this->Login_model->getview_permission();
      $this->load->view('forest_add/view_mainhome',$data);
    }   

这是我的标准代码:

        function getview_permission() //Stock
        {   
        $this->db->select('*');
        $this->db->from('forest_permission');
        $this->db->order_by("per_id", "asc");
        $query = $this->db->get();
         return $query->result();
        }

感谢@

使用以下mysqli函数,我们可以实现100%正常工作

using following mysqli function to we can achieve this 100% worked

 config['set_charset']=array( $db, 'utf8');

替换$ db代替您的db连接变量。

replace $db instead your db connection variable.