zoukankan      html  css  js  c++  java
  • tp5总结(四)

    数据库

    1.数据库配置

    1-1.配置文件配置【http://ww:7070/tp5-3/public/】

    1-2.Db::connect配置【数组和字符串方式】【http://ww:7070/tp5-3/public/index/index/db1和http://ww:7070/tp5-3/public/index/index/db2】

    1-3.model配置【数组和字符串方式】【http://ww:7070/tp5-3/public/admin】

    2数据库普通链接

    2-1.普通查询两种【http://ww:7070/tp5-3/public/index/test/test1和http://ww:7070/tp5-3/public/index/test/test2】【返回查询结果】

    2-2.普通插入三种【http://ww:7070/tp5-3/public/index/test/test3和4和5】【返回影响的条数】

    注意:Db::getLastSql()可以获取sql语句

    2-3.普通删除三种【http://ww:7070/tp5-3/public/index/test/test6】【返回影响条数】

    2-4.普通更新三种【http://ww:7070/tp5-3/public/index/test/test7】【返回影响条数】

    3.常用方法

    3-1.where限制条件【http://localhost:7070/tp/public/admin/sql/awhere1或awhere2和awhere3】

    3-2.order升降序【http://localhost:7070/tp/public/admin/sql/aorder】

    3-3.limit限制上限和分页【http://localhost:7070/tp/public/admin/sql/alimit1和http://localhost:7070/tp/public/admin/sql/alimit2】

    3-4.group分组以及获取最大最小总量平均值 字段重命名【http://localhost:7070/tp/public/admin/sql/agroup】

    3-5.having对于分组查询的结果进行筛选【http://localhost:7070/tp/public/admin/sql/ahaving】

    3-6.join联动查询【http://localhost:7070/tp/public/admin/sql/ajoin】

    3-7.union查询多个表,返回一个包含所有结果的数组【http://localhost:7070/tp/public/admin/sql/aunion】

    3-8.distinct只会返回不重复的值【http://localhost:7070/tp/public/admin/sql/adistinct】

    3-9.聚合查询【avg,count,max,min,sum】

    4.事务机制

    4-1.主动控制【http://localhost:7070/tp/public/admin/sql/event1】

    4-2.手动控制【http://localhost:7070/tp/public/admin/sql/event2】

  • 相关阅读:
    C++的常量折叠(一)
    如何写面向互联网公司的求职简历
    所有的程序员都是自学成才
    [一个经典的多线程同步问题]解决方案一:关键段CS
    [一个经典的多线程同步问题]问题引入
    多线程笔记--原子操作Interlocked系列函数
    【分治法】归并分类
    内存字节对齐一网打尽,再也不纠结
    在C语言中基本数据类型所占的字节数
    多线程笔记--先了解工具
  • 原文地址:https://www.cnblogs.com/douyaer/p/8109916.html
Copyright © 2011-2022 走看看