How to deal with incomplete batch data insertion in phpmysql-php Tutorial

Source: Internet
Author: User
I use mysqli for batch data insertion in phpmysql. I need to insert 52 records in one breath. occasionally, a few records are missing and cannot be inserted successfully. Currently, this table is 3.4 MB, this will not happen if you clear this table? ------ Solution -------------------- only 53 items will be missed ??? What are the broken code? paste it and see why? & nbsp; p php mysql batch data insertion is not complete
I am using mysqli. I need to insert 52 records in one breath. occasionally, a few records are missing and have not been inserted successfully. now the table is 3.4 MB. if I clear this table, this will not happen?


------ Solution --------------------
Only 53 items will be missed ??? What is the code? paste it out and check it out.

Also: why not use pdo?
------ Solution --------------------
It's not a code issue. you can think of this database as access, so it's hard to understand the situation of data loss.
If you want to use a small database, I suggest you take a look at mongoDB, which is promising and small.
------ Solution --------------------
Is mysql and access not a database of the same level?
Why is data loss hard to understand? Mysql lost data, which is hard to understand in 53 cases!


By the way, mongoDB is not a small database, it is nosql, and it is not the same as mysql. For example, foursquare uses it to process customer geographic information of several hundred GB.

-Curious, how did you get this medal.

Reference:
It's not a code issue. you can think of this database as access, so it's hard to understand the situation of data loss.
If you want to use a small database, I suggest you take a look at mongoDB, which is promising and small.

------ Solution --------------------
MongoDB is really not a small database ............ It's a terrible thing to grow up.
The other 52 items are too exaggerated.
We recommend that you use transaction processing.
If the error persists, the code is faulty.
------ Solution --------------------
Success!

Reference:
MongoDB is really not a small database ............ It's a terrible thing to grow up.
The other 52 items are too exaggerated.
We recommend that you use transaction processing.
If the error persists, the code is faulty.

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.