本文实例讲述了CI框架常用函数封装。分享给大家供大家参考,具体如下:
/**
* 封装查询函数
*/
public function get_what($table='',$where=array(),$fields = ' * '){
if( '' == $table ){
return false;
}
//查询并返回相关结果
$query = $this->db->select($fields)->where($where)->get($table);
$res = $query->result_array();
return