FileMaker 9 和 FileMaker 9 PHP API - 总记录数?
我能看到获得设置某种分页机制所需的总记录数的唯一方法是:
$fileMakerObj = new FileMaker( /* credentials redacted */ );
$fc = $FileMakerObj->newFindCommand('someLayout');
//Get max Record count for someLayout
$fc->setRange(0,0);
$result1 = $fc->execute();
$maxRecords = $result1->getTableTotalCount();
$fc->clearRange();
//Window 0-100 of $maxRecords
$fc->setRange(0,100);
$page1 = $fc->execute();
//Repeat as necessary
是否有我遗漏的东西,或者这是唯一的解决方案?
The only way I can see to get a total record count necessary for setting up some sort of pagination mechanism would be something like:
$fileMakerObj = new FileMaker( /* credentials redacted */ );
$fc = $FileMakerObj->newFindCommand('someLayout');
//Get max Record count for someLayout
$fc->setRange(0,0);
$result1 = $fc->execute();
$maxRecords = $result1->getTableTotalCount();
$fc->clearRange();
//Window 0-100 of $maxRecords
$fc->setRange(0,100);
$page1 = $fc->execute();
//Repeat as necessary
Is there something I am missing, or is this the only solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个微小但重要的变化:
如果您设置
获取 RecordCount,实际上您没有设置范围并扫描整个集合。如果你使用
相反的方式,你只会读取一条记录。然后用于
获取底层表中的记录数或
过滤后的记录数。
One minor but important change:
if you set
to get the RecordCount, you actually don's set a range and scan through the set. If you use
instead, you only read one record. Then use
to get the record count in the unterlaying table or
for the count of the filtered records.