[FX.php List] Pulling data directly from findResult

Gareth Evans gareth.evans at schawk.com
Thu Oct 16 09:20:36 MDT 2008


Here's one way to manually step through the result array using each().

//record 1
$rec = each($findResult['data']);
echo $findResult['data'][$rec['key']]['desiredfieldname'][0];

// record 2
$rec = each($findResult['data']);
echo $findResult['data'][$rec['key']]['desiredfieldname'][0];

Don't know why you wouldn't want to use a loop of some sort though...
-- 
GARETH EVANS


> From: Jonathan Schwartz <jschwartz at exit445.com>
> Reply-To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> Date: Thu, 16 Oct 2008 08:02:34 -0700
> To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> Subject: Re: [FX.php List] Pulling data directly from findResult
> 
> Great!  That seems to retrieve the first one.  How do I call others
> in the array?
> 
> J
> 
> At 4:43 PM +0200 10/16/08, Gjermund Gusland Thorsen wrote:
>> echo $findResult['data'][key($findResult['data'])]['desiredfieldname'][0];
>> 
>> ggt
>> 
>> 2008/10/16 Jonathan Schwartz <jschwartz at exit445.com>:
>>>  Hi Foks,
>>> 
>>>  Instead of using foreach, how can data be pulled from the $FindResult
>>> array?
>>> 
>>>  Trying syntax such as this, without result:
>>> 
>>>  $desireddatavalue = $findResult['data'] ['desiredfieldname']
>>> 
>>>  I know it's not right.  I'm just missing that last syntax step....I think.
>>> 
>>>  Assume that I want to manually step through found records, string with
>>>  first.
>>> 
>>>  Thanks
>>> 
>>>  Jonathan
>>> 
>>>  --
>>>  Jonathan Schwartz
>>>  Exit 445 Group
>>>  jonathan at exit445.com
>>>  http://www.exit445.com
>>>  415-370-5011
>>>  _______________________________________________
>>>  FX.php_List mailing list
>>>  FX.php_List at mail.iviking.org
>>>  http://www.iviking.org/mailman/listinfo/fx.php_list
>>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> -- 
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-370-5011
> _______________________________________________
> 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