codeIgniter sql uft抓取问题

时间:2013-09-15 04:46:54

标签: php mysql codeigniter utf-8

以下代码用于返回area_name,其中包含中文字符。

    public function get_area_name($area_id)
    {
        $this->db->select("*");

        $this->db->from("area");

    $this->db->where("area_id", $area_id);

        $query = $this->db->get();

        $obj_area = $query->_fetch_object();

        return $obj_area->area;
    }

在另一个函数中,代码将获得返回值并返回断开的字符。

   $area = $this->get_area_name($area_id);

在database.php中,config设置如下。

 $db['default']['char_set'] = 'utf8';
 $db['default']['dbcollat'] = 'utf8_general_ci';

我认为没有关系uft-8是因为php文件中的问题而设置的html标题。 但是,html标题也是用utf-8设置的。

0 个答案:

没有答案