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.