Home >Backend Development >PHP Tutorial >Thinkphp3.2.3 version database addition, deletion, modification and query implementation code

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

不言
不言Original
2018-06-07 10:53:503600browse


#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();

2. Find a piece of data

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

3. Query all data in multiple tables##

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

4. Query all data

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

5.Add a piece of data

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

6. Delete a piece of data

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

7. Modify a piece of data

M('a表')->where('id=5')->save();
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!

Statement:
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