[FX.php List] fx.php / PHP API - error 401 and foundCount
Alex Gates
alex at gandrpublishing.com
Thu Feb 28 11:37:27 MST 2008
Hello everyone -
In experimenting with the PHP API one difference I found between that
and fx.php is that if no records match the query, you can't get a
foundcount by using getFoundSetCount() with the API.
(With fx, you can always get the foundcount with $result['foundCount'];
The only thing you get back is the error - so it seems that adds an
extra step to the query.
if (FileMaker::isError($result))
{
if ($result->code == 401)
{
$found_count = 0;
}
}
if (!FileMaker::isError($result))
{
$found_records = $result->getRecords();
$found_count = $result->getFoundSetCount();
}
Is it just me, or does this add more steps?
I understand we should always be checking for an error with fx - so this
may be good practice - - but I can't imagine why a query that doesn't
find any records can't have a FoundSetCount of 0. Afterall, no records
were found.
Am I missing something here?
More information about the FX.php_List
mailing list