简体   繁体   English

使用PHP将大型更新CSV上载到mySQL

[英]Uploading Large Updates CSV to mySQL using PHP

We are running Seibel CRM to capture the customer subscription. 我们正在运行Seibel CRM以捕获客户订阅。 A daily extract of all customers' records is being sent to me on daily basis to do some analysis and to be used for other tasks. 每天都会将所有客户记录的每日摘要发送给我,以进行一些分析并用于其他任务。 I need to upload the same file into my mySQL using a PHP page as this would be done by one of the supervisors. 我需要使用一个PHP页面将同一文件上传到mySQL中,因为这是由一名主管完成的。

The file is about 47MB and contain about 200,000 records. 该文件约为47MB,包含约200,000条记录。 It increases by 500-550 records per day. 每天增加500-550条记录。 The customer reference is his number. 客户参考是他的电话号码。 If the customer unsubscribe or his service get terminated, the customer number is assigned to another number after 3 months; 如果客户退订或服务终止,则3个月后将客户编号分配给另一个编号; this would mean that I either need to search for additions or changes. 这意味着我需要搜索添加或更改。

I need help with the 1st time upload and the daily upload routine that need to take place. 我需要第一次上传和日常上传例程方面的帮助。

Thanking you in advance, 预先感谢您,

Aziz 阿齐兹

I had a problem like you. 我遇到了像你这样的问题。 For my problem LOAD DATA LOCAL INFILE '' INTO TABLE was a good solution ( approximately 1 000 000 records). 对于我的问题,LOAD DATA LOCAL INFILE''INTO TABLE是一个很好的解决方案(大约1000000条记录)。 Upload file with php and then call the sql query. 使用php上传文件,然后调用sql查询。 But the structure of the file must be the same as in the mysql table. 但是文件的结构必须与mysql表中的相同。

Kind Regards 亲切的问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM