• ci的一些数据库操作


    简单操作:

    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()
  • 相关阅读:
    WebRTC中的NetEQ
    VoIP基本原理
    NetEQ主要文件简介
    声纹识别
    杂记(2019.04.13)
    概率论基础复习
    机器学习复习:模型评估指标
    传统机器学习算法复习:逻辑回归、因子分解机和梯度提升树
    Tensorflow中循环神经网络及其Wrappers
    einsum:爱因斯坦求和约定
  • 原文地址:https://www.cnblogs.com/maoriaty/p/9429306.html
Copyright © 2020-2023  润新知