基本上,我有一个函数可以返回数据库内的“项目”总数,这些项目的限制是40,如果返回的值小于40我希望它执行操作,从而将限制增加1直到它再次达到40,之后我希望它停止,我当前使用的代码如下所示
$count = $row['COUNT'];
foreach($result as $row) {
if($count < 40) {
//I want to execute a function, thus increasing the $count by one evertime
//until it reaches 40, after that it must stop
}
}