首页 > 其他 > 详细

CI 快速上手

时间:2018-01-28 12:24:55      阅读:212      评论:0      收藏:0      [点我收藏+]

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 快速上手

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!