早上好!
我正在尝试做一些应该相当简单的事情,但我找不到合适的答案。我试图从表格中下拉0-999,然后是1000-1999,2000-2999等。这是我到目前为止所得到的,但它仍然在拉低0-999 +,因为它增加
for($k = 0; $k < 10000; $k += 1000)
{
$query = "select * from TABLENAME LIMIT 1000 OFFSET " . $k;
.....
}
答案 0 :(得分:3)
试试这个:
for($k = 0; $k < 10000; $k += 1000)
{
$query = "select * from TABLENAME LIMIT {$k},1000";
.....
}
答案 1 :(得分:0)
$start = 0;
$end = 0;
for($k = 0; $k < 10000; $k += 1000)
{
$flag = $start+999;
$end = 1000;
$query = "select * from TABLENAME LIMIT $start,$end";
.....
$start = $flag+1;
}