开发者

FileMaker 9 & PHP API - Total record count?

开发者 https://www.devze.com 2022-12-20 05:10 出处:网络
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:

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();  
$maxRecor开发者_运维百科ds = $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?


One minor but important change:

if you set

$fc->setRange(0,0);

to get the RecordCount, you actually don's set a range and scan through the set. If you use

$fc->setRange(0,1);

instead, you only read one record. Then use

$result1->getTableRecordCount();

to get the record count in the unterlaying table or

$result1->getFoundSetCount();

for the count of the filtered records.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号