[FX.php List] Pulling data directly from findResult

Dale Bengston dbengston at tds.net
Thu Oct 16 19:08:21 MDT 2008


Or...

$queryData = current($queryResult['data']);

If you haven't pointed to anything else in $queryResult['data'] yet,  
that returns the first element. Just be sure there's something in  
$queryResult['data'] (not an empty found set) before you apply  
current(), or it will yell at you.

Dale

On Oct 16, 2008, at 4:27 PM, Bob Patin wrote:

> You can always pull the first element in the foundset by just doing  
> this:
>
> foreach($queryResult[] as $key=>$queryData);
> $name = $queryData['name'][0];
> $address = $queryData['address'][0];
>
> and so on.
>
> No need to do anything more complex than that...
>
> Methinks you're over-complicating this... :)
>
> But of course, maybe you have a reason that I'm missing...
>
> BP
>
> Bob Patin
> Longterm Solutions
> bob at longtermsolutions.com
> 615-333-6858
> http://www.longtermsolutions.com
> iChat: bobpatin
> AIM: longterm1954
> FileMaker 9 Certified Developer
> Member of FileMaker Business Alliance and FileMaker TechNet
> --------------------------
> FileMaker hosting and consulting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>
> On Oct 16, 2008, at 10:02 AM, Jonathan Schwartz wrote:
>
>> Great!  That seems to retrieve the first one.  How do I call others  
>> in the array?
>>
>> J
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list