php+mysql high concurrency how to download data in a loop based on ID to avoid duplication (interface)
。。。。
。。。。 2020-02-08 11:30:16
0
1
1057

For example, the table content is

id name

1 a

2 b

3 c

4 d

th The first download id is 1

The second download id is 2

The third download id is 3

The fourth download id is 4

## After #id is 4, it starts from 1 again and keeps looping indefinitely. It must be able to support high concurrency!

Before I used to save the id in another table. Every time I downloaded, I read the last id from the table. When downloading the data, I just needed data larger than this id, but the concurrency was high. Duplicate data will be downloaded, and it is a bit troublesome to operate another table. Does anyone have any other good methods?

。。。。
。。。。

reply all(1)
小可耐

Add delay or array_unique. The main thing is not to download duplicate data, and not to download the ID for use.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!