【发布时间】:2013-07-14 12:15:06
【问题描述】:
我想写这个sql查询
SELECT count(*) FROM menu WHERE CHAR_LENGTH(CONTENT) > 20;
进入Codeigniter查询,怎么写?请帮忙。
我正在尝试用下面的查询编写上面的 sql 查询。
public function record_count() {
$this->load->database();
$this->db->where('parent_id >','0');
// $this->db->where('content>','20'); //if the field "content" is greater then 20 characters
$this->db->from('menu');
return $this->db->count_all_results();
}
【问题讨论】:
标签: mysql codeigniter