How does mysql-thinkphp copy and update a field during data operations at the same time?

Source: Internet
Author: User
How to implement the following functions in a statement in the thinkPHP framework: 1. Copy the content in the table and update a field in the copied content. For example, M (& #039; table & #039;)-& amp; gt; addAll ($ data, $ option, $ replacetrue ); $ data here is the copied data and inserted into the table, $ option... how can I implement the following functions in a statement in the thinkPHP framework:
1. Copy the content in the table and update a field in the copied content.
For example:
M ('table')-> addAll ($ data, $ option, $ replace = true );
$ Data here is the copied data and inserted into the table. $ option is the parameter for data update, and $ replace is the parameter that allows data update when data is inserted.
How can I use the addAll () function, that is, can the $ data parameter be many select records? How to write the $ option parameter? Can I use an operation expression?

Please forgive me for your first contact with thinkPHP ~

Reply content:

How can I implement the following functions in a statement in the thinkPHP framework:
1. Copy the content in the table and update a field in the copied content.
For example:
M ('table')-> addAll ($ data, $ option, $ replace = true );
$ Data here is the copied data and inserted into the table. $ option is the parameter for data update, and $ replace is the parameter that allows data update when data is inserted.
How can I use the addAll () function, that is, can the $ data parameter be many select records? How to write the $ option parameter? Can I use an operation expression?

Please forgive me for your first contact with thinkPHP ~

The native SQL statement has been used to replace the addAll function. thinkphp has many pitfalls.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.