码迷,mamicode.com
首页 > 其他好文 > 详细

CI 快速上手

时间:2018-01-28 12:39:18      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:color   快速   last   get   cape   size   tle   log   where   

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();
 

 

 

//查询   

CI 快速上手

标签:color   快速   last   get   cape   size   tle   log   where   

原文地址:https://www.cnblogs.com/zhaoyang-1989/p/8370644.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!