CURD
//查询
$sql = ‘select * from tab_city where fatherID=0‘;
$list = $this->db->query($sql)->result_array();
$list2 = $this->db->where([‘fatherID‘=>0])->get(‘tab_city‘)->result_array();
$this->db->where(‘id >=‘,3)
$list2 = this->db->get_where(‘together_car_list‘,$where,$page_size*($page-1),($page_size))->result_array(); $this->db->insert(‘together_car_list‘, $insert_arr);
$this->db->like(‘title‘, ‘match‘);
$this->db->like(‘title‘, ‘match‘);
$this->db->or_not_like(‘body‘, ‘match‘);
$this->db->like(‘title‘, ‘match‘, ‘before‘); // Produces: WHERE `title` LIKE ‘%match‘ ESCAPE ‘!‘
$this->db->like(‘title‘, ‘match‘, ‘after‘); // Produces: WHERE `title` LIKE ‘match%‘ ESCAPE ‘!‘
$this->db->like(‘title‘, ‘match‘, ‘both‘); // Produces: WHERE `title` LIKE ‘%match%‘ ESCAPE ‘!‘
$this->db->order_by(‘title‘, ‘DESC‘);
$this->db->order_by(‘title DESC, name ASC‘);
$this->db->group_by("title");
$this->db->group_by(array("title", "date"));
echo $this->db->last_query();
//查询