Bulk Data Import Database

Source: Internet
Author: User
Tags import database

1. The problem arises because one-time import says too much to cause

① time longer than 30s required modification configuration resolution ② because the disposable memory is too large also need to modify the configuration

I do not want to modify the configuration, so use the following method is TP5 INSERT statement

In short, the overall idea is divided into a convenient array of units (loops) into the SQL statement inserted every time n;

$ZW _box[]=[      ' zhiwei ' = $zhicheng [' Zhiwei '],      ' ygid ' + $zhicheng [' Ygid '],      ' Choubei ' =>$ zhicheng[' Choubei ',      ' Yuefen ' + date ("Y-m"),      ' djhf ' = ' wu ',  ' sjry ' = ' none ',  ' sanid ' = ' None ' ",  ' zzqk ' = $zhicheng [' Zzzt '],  ' Didian ' and ' Diqu ']];for ($i = 0; $i < Ceil (count ($zw _box)/ $i + +) {echo db::name (' Zw_dy ')->insertall (Array_slice ($zw _box, $i *100,100));}

Bulk Data Import Database

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.