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】
tp5总结(四)的更多相关文章
- PHP7 学习笔记(十四)Reids 键空间通知配合TP5 实现分布式延时任务
测试环境:windows 10 + phpStudy 配置redis配置文件 redis.windows.conf notify-keyspace-events "Ex" 重启re ...
- TP5.1:request请求对象(使用四种方式获取)
准备: 在index/controller下创建一个名为requests.php的文件(注意:不要起名为request,因为它是关键字,不被允许起名) 动态方法和静态方法的区别: 静态方法:publi ...
- TP5学习基础二:目录结构、URL路由、数据操作
一.安装1.使用git或者composer(composer update)进行实时更新,区别在于git不会清空核心框架目录而composer会清空.2.使用官网打包好的TP压缩包(解压即可用)-&g ...
- 接口开发,tp5结合swagger-ui安装方法
今天看到老java用的swagger提供接口,美观好用,方便维护,不是写好接口之后再写接口文档,麻烦的要死.网上找了找结合php的方法,在此记录一下,以后再开发接口就可以方便很多了. Swagger的 ...
- TP5 路由使用
这里可以直接从第四条开始看 原文http://www.upwqy.com/details/12.html 1 文档链接 tp5路由官方文档 https://www.kancloud.cn/manua ...
- 【转】史上最详细的Composer安装tp5教程
http://www.thinkphp.cn/topic/52362.html Composer安装tp5教程1.下载composer先介绍几个网站Composer官网https://getcompo ...
- TP5 数据库迁移工具 migrate 教程
第一步: 安装compose,不赘述,安装详情可百度或查看https://pkg.phpcomposer.com/#how-to-install-composer 第二步: 通过 composer ...
- TP5调用微信JSSDK 教程 - 测试成功案例
前提:必需了解TP5的全局配置,扩展目录,composer,依赖注入的概念: 第一步:首先配置加载官方JSSDK类 "autoload": { "files": ...
- PHP 服务器及TP5框架遇到的几个错误
一.Call to undefined function imagecreatefrompng(): LAMP环境搭建的博客,在提交内容的时候TP5框架报了一个错误,Call to undefined ...
随机推荐
- 视音频数据处理入门:PCM音频采样数据处理
===================================================== 视音频数据处理入门系列文章: 视音频数据处理入门:RGB.YUV像素数据处理 视音频数据处理 ...
- Maven项目导出jar包配置
<!-- 第一种打包方式 (maven-jar-plugin), 将依赖包和配置文件放到jar包外 --> <build> <sourceDirectory>src ...
- bzoj千题计划111:bzoj1021: [SHOI2008]Debt 循环的债务
http://www.lydsy.com/JudgeOnline/problem.php?id=1021 如果A收到了B的1张10元,那么A绝对不会把这张10元再给C 因为这样不如B直接给C优 由此可 ...
- 解除单个文件的与svn服务器的关联
有些文件和个人开发环境有关不需要和svn服务器做同步,可以取消其和svn服务的关联. 右键选中要取消关联的文件,右键菜单 Tortoise SVN ---> unversion and a ...
- jdk1.8.0_45源码解读——LinkedList的实现
jdk1.8.0_45源码解读——LinkedList的实现 一.LinkedList概述 LinkedList是List和Deque接口的双向链表的实现.实现了所有可选列表操作,并允许包括null值 ...
- nginx 跨域配置
server { listen 80; server_name b.com; location /{ if ( $http_referer ~* (a.com|b.com|c.com) ) { Acc ...
- 【Codeforces858F】Wizard's Tour [构造]
Wizard's Tour Time Limit: 50 Sec Memory Limit: 512 MB Description Input Output Sample Input 4 5 1 2 ...
- Throwable、Error、Exception、RuntimeException 区别
1.java将所有的错误封装为一个对象,其根本父类为Throwable, Throwable有两个子类:Error和Exception. 2.Error是Throwable 的子类,用于指示合理的应用 ...
- node.js、git、bootstrap等安装配置
纯记录 一,安装node.js 1 官方网址 http://nodejs.org/ 点击install 下载node-v0.10.22-x86.msi 2 安装,修改安装目录到d盘,一路next,无 ...
- DRM学习总结(1)--- DRM框架介绍
一.DRM 简介 In computing, the Direct Rendering Manager (DRM), a subsystem of the Linux kernel, interfac ...