最近再用CI框架,有时候会懵一下,因为没太多时间看手册,所以用到的自己先总结一下,免得到时候自己还得花时间再看,下面贴代码:
我先用的是
public function get_cands_where( $where, $begin=null, $size=null, $paixu = 'cand_city', $projs = '')
{
if( isset( $begin ) && isset( $size ) ){
$this->db->limit( $size, $begin );
}
$this->db->where( $where );
if (!empty($projs)) {
foreach ($projs as $projkey => $projvalue) {
$this->db->or_where('proj_id', $projvalue['proj_id']);
}
}
$this->db->order_by( $paixu );
$query = $this->db->get( $this->table_name );
$result = $query->result_array();
return $result;
}
SELECT COUNT(*) AS count FROM `tbl_cand` WHERE `cand_phone` = 2147483647 AND `cand_email` = '123@162