[FX.php List] Current function

Blair Duncan Blair.Duncan at bbdo.ca
Sat Nov 22 08:37:32 MST 2008


On 13/11/08 12:26 PM, "Anders Monsen" <andersm at alamark.com> wrote:

> Revisiting this function, is it possible to get the FileMaker record
> ID via current( )? I use this to pull fields from a found set of one,
> and I need to send over the recid in a form.
>
> Until now I have been using something like this:
>
> foreach($createResult['data'] as $key=>$value) {
> $recordDetails = explode('.',$key);
> $currentRecord = $recordDetails[0];
> }
>
> While I like the elegance of current( ), I am not sure how to isolate
> the recid piece, which would be very useful.
>
> Thanks,
> Anders
>

As others have commented, I find it a bit confusing to see a foreach loop
when I know there is only 1 record. I prefer the use of current() and key().

$thisRecord = current($result['data']);
$thisRecord_IdMod = explode('.',key($result['data']));

$thisRecord_Id = $thisRecord_IdMod[0];
$thisRecord_Mod = $thisRecord_IdMod[1];


Please consider the environment before printing this e-mail.

This message and any attachments contain information, which may be confidential or privileged. If you are not the intended recipient, please refrain from any disclosure, copying, distribution or use of this information. Please be aware that such actions are prohibited. If you have received this transmission in error, kindly notify us by e-mail to helpdesk at bbdo.com. We appreciate your cooperation.



More information about the FX.php_List mailing list