Thinkphp-addall Method-How does the AddAll () method inside the thinkphp determine if the update was successful? The method returns as if it were the first inserted ID.
The AddAll () method is used in the project, and transaction processing is turned on.
If the AddAll () method is not fully inserted successfully, it is rolled back.
How to Judge AddAll () all inserted successfully.
Maybe there are other better options?
Reply content:
The AddAll () method is used in the project, and transaction processing is turned on. If the AddAll () method is not fully inserted successfully, it is rolled back. How to Judge AddAll () all inserted successfully. Maybe there are other better options?
AddAll is written to the database one time or all succeeds or all fails. SQL performs insert into tbl_name (a,b,c) VALUES (All-in-one), (4,5,6), (7,8,9);
I remember AddAll. If you set the primary key of the data table and so on, if it exists then the update does not exist insert:
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.