我有几行代码,但找不到正确使用它的正确方法。
$cc = 0;
$tt = 50;
while ($row = mysql_fetch_assoc($result)) {
//building array with values from DB.
if (++$cc < $tt)
continue;
for ($i = 0; $i < $tt; $i++) {
//Work with the array
}
}
假设我在 DB 中有 133 个结果。它将获得前 50 个 - 在 for 循环中执行某些操作,然后再执行 50 个,将再次通过 for 循环并停止。最后 33 个结果将保持不变。它会得到它们,但因为无法达到 50 将停止并且它们不会通过 for 循环。
我的问题是如何在下面的循环中“发送”它们?