[FX.php List] A nagging question: Foreach

Head Honcho headhoncho at customikesolutions.com
Mon Sep 22 22:26:14 MDT 2008


Hi All
On 23/09/2008, at 12:33 PM, Derrick Fogle wrote:

> Dang, I knew there was a much easier, more "compact code" way than  
> how I was doing it. Thanks Andy, those are the most personally  
> useful code tips I've seen in a while.
>
> On Sep 22, 2008, at 9:26 PM, Andy Gaunt wrote:
>
>> $value = current($queryResult['data']);
>>
>> $queryResult = FMFind (true, 'full',false);

And for those using the API for php, there is:

for the first (only) record.
$theRecord= $resultSet->getFirstRecord();
for the last record.
$theRecord= $resultSet->getLastRecord();
for all records:
$theRecords = $resultSet->getRecords();
and if you know which record you're looking for, eg the second record
$theRecord = $theRecords[1];

HTH

Regards

Michael Ward
--
Head Honcho
CustoMike Solutions
Member, FileMaker Business Alliance
Member, FileMaker Technical Network
FileMaker 7 Certified Developer
FileMaker 8 Certified Developer
FileMaker 9 Certified Developer
10 Wandoo Crt
Wheelers Hill, 3150
ph 0414 562 501
headhoncho at customikesolutions.com




More information about the FX.php_List mailing list