thinkphp3.2.3版本的数据库增删改查实现代码
作者:jingxian 时间:2023-10-19 15:07:53
框架thinkphp
版本:3.2.3
内容:数据库操作
1. 多表查找一条数据
M('a表')->join("b表 on b表.id=a表.id")->where('条件')->find();
2.查找一条数据
M('a表')->where('条件')->find();
3.多表查询所有数据
M('a表')->join("b表 on b表.id=a表.id")->where('条件')->select();
4.查询所有数据
M('a表')->where('条件')->select();
5.增加一条数据
M('a表')->add($data);
6.删除一条数据
M('a表')->where('条件')->delete($data);
7.修改一条数据
M('a表')->where('id=5')->save();
标签:thinkphp,增,删,改,查
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
IE6实现min-width
2008-06-12 12:40:00
java实现数据库的数据写入到txt的方法
2024-01-28 06:22:16
Python3中.whl文件创建及使用
2022-11-05 00:17:50
![](https://img.aspxhome.com/file/2023/8/130818_0s.jpg)
javascript表单验证和Window详解
2023-07-14 02:14:38
Python简单计算文件MD5值的方法示例
2023-06-07 06:06:42
跨浏览器实现float:center,No CSS hacks
2008-08-22 12:59:00
python Django模板的使用方法(图文)
2022-03-30 04:23:52
![](https://img.aspxhome.com/file/2023/9/63889_0s.png)
python网络编程学习笔记(五):socket的一些补充
2022-02-03 23:22:48
深入浅析php json 格式控制
2024-05-11 09:51:53
mysql中的mvcc 原理详解
2024-01-18 05:10:13
![](https://img.aspxhome.com/file/2023/0/74860_0s.jpg)
详解Python垃圾回收机制和常量池的验证
2022-12-28 09:58:29
Python绘制交通流折线图详情
2023-04-29 01:26:36
![](https://img.aspxhome.com/file/2023/2/86652_0s.png)
python实现简易名片管理系统
2022-12-23 13:14:53
![](https://img.aspxhome.com/file/2023/2/112842_0s.jpg)
SQL Server中应当怎样得到自动编号字段
2009-01-15 12:48:00
SQL Server 2008 到底需要使用哪些端口?
2012-11-30 20:29:41
java代码实现mysql分表操作(用户行为记录)
2024-01-17 22:57:09
python 网络编程要点总结
2023-09-30 06:15:38
python shell命令行中import多层目录下的模块操作
2023-08-24 11:28:40
![](https://img.aspxhome.com/file/2023/1/115691_0s.jpg)
Python中Dict两种实现的原理详解
2022-11-13 06:20:29
SQl Function 创建函数实例介绍
2024-01-12 19:57:46
![](https://img.aspxhome.com/file/2023/7/108507_0s.jpg)