PHP mysql 分批查询

你可以查zhidao1W条,然后按每版个数据100条来分。

1
2
3
$data = select * from table limit 10000
$chunk array_chunk($data, 100);
print_r($chunk);

 

也可以每次查权询 100 条

1
2
3
4
5
6
$start = 0;
while($data = select * from table limit $start, 100)
{
print_r($chunk);
$start += 100;
}
posted @ 2020-05-29 13:40  星云惊蛰  阅读(515)  评论(0)    收藏  举报