无法获取此内容。 如何确定 while 循环内 tep_db_fetch_array 的大小?
我想这样做:
$i=0;
while($a = tep_db_fetch_array($query)){
if($i==5){
// start a div i.e.
}
//do sth here
if($i>=count($a)){
//close the div i.e.
}
$i++;
}
但它不起作用,因为 $a 不是整个数组,只是指向实际查询结果的指针。我做错了什么,或者该怎么做?
最佳答案
尝试使用函数tep_db_num_rows,如下所示:
$i=0;
while($a = tep_db_fetch_array($query)){
//do sth here
if($i>=tep_db_num_rows($query)){
//do sth other here for the last entry
}
$i++;
}
关于php - 如何确定 while 循环内 tep_db_fetch_array 的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23915935/