国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

How does MySQL PHP read data cyclically from the database in batches?
迷茫
迷茫 2017-07-01 09:11:51
0
2
897

If five items are read from the database each time, how should the program continue to loop until all loops are completed.
add a

$a = true;
//然后用while循環(huán)
//在數(shù)據(jù)庫里設計個字段,為判斷有沒有取出來過這條數(shù)據(jù)的字段,默認為沒取出來過
//然后用foreach把每次取出來的每條數(shù)據(jù)都標記為已取出過,直到所有數(shù)據(jù)都被標記為已取出過來,循環(huán)停止。

Is this logic correct?

迷茫
迷茫

業(yè)精于勤,荒于嬉;行成于思,毀于隨。

reply all(2)
過去多啦不再A夢

You use limit. Then record the id until the id is greater than maxid, right?

小葫蘆

You can use the principle of paging query. .

$count = '100';//總條數(shù)
$strip = 0;
$num = $count/5;//循環(huán)多少次
for($i=1;$i<=$num;$i++)
{
 $sql = "select * from `table` order by id limit ".$strip.",5";
 $strip += 5;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template