我有问题查看使用CodeIgniter从mysql数据库检索泰米尔语内容。但相同的代码在核心php中工作。我在下面附上了我的代码。请检查我的代码并给出答案,如果有任何更改。如何在codeigniter中显示泰米尔内容形式的mysql数据库
这是我的看法代码:
<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();
}
感谢@
当我将我的SQL列数据类型更改为utf8_general_ci时,它为我工作。 –
谢谢詹姆斯的工作 – user3839366
不客气的兄弟... –