Thinkphp3.2.3 version database addition, deletion, modification and query implementation code

不言
Release: 2023-03-30 11:38:02
Original
3483 people have browsed it


#The following brings you an implementation code for database addition, deletion, modification and query of thinkphp3.2.3 version. It’s pretty good. I’ll share it with you now and give it as a reference.

Recommended related mysql video tutorials: "mysql tutorial"

Framework thinkphp

##Version: 3.2.3

Content: Database operation

1. Find a piece of data in multiple tables

M('a表')->join("b表 on b表.id=a表.id")->where('条件')->find();
Copy after login

2. Find a piece of data

M('a表')->where('条件')->find();
Copy after login

3. Query all data in multiple tables##

M('a表')->join("b表 on b表.id=a表.id")->where('条件')->select();
Copy after login

4. Query all data

M('a表')->where('条件')->select();
Copy after login

5.Add a piece of data

M('a表')->add($data);
Copy after login

6. Delete a piece of data

M('a表')->where('条件')->delete($data);
Copy after login

7. Modify a piece of data

M('a表')->where('id=5')->save();
Copy after login
Related recommendations:


ThinkPHP Implementation of Update Data Example Detailed Explanation (demo)


ThinkPHP Basic Add, Delete, Check and Change Operation Example Tutorial


The above is the detailed content of Thinkphp3.2.3 version database addition, deletion, modification and query implementation code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!