我有問題查看使用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
不客氣的兄弟... –