简单操作:
insert('table', array) get('table',) get_where('table', array, $limit, $offset)->result()/result_array() update('table', array, 'id = xx') $this->db->where('id', $id)->delete('table') $this->db->delete('table', array); $this->db->where(array)->count_all_result('table'); $this->db->count_all('table') $this->db->order_by('times', 'DESC')->get('table', $num, ($page-1)*$num)->result(); 查询: $this->db->query(sqlstring,array绑定参数)->result()/result_array() $this->db->query(sqlstring)->row()/row_array()/num_rows() 插入 $this->db->query(sqlstring) 查询构造器 $this->db->get('table', 10, 20)->result()/result_array() // limit 20, 10 $this->db->insert('table', array); 错误 $this->db->error() 查询辅助函数 $this->db->insert_id()/count_all()/insert_string('table',array)/update_string() 其他 $this->db->select()/select_max(),$this->db->get('table') $this->db->select()/distinct()/from()/join('comments', 'comments.id=blogs.id')/where()/like()/group_by()/having()/order_by()/limit()/count_all_results()/count_all()/insert()/replace()/set()/update()/empty_table()/truncate()