[FX.php List] Getting "-recid" for 1 record

AC ac at pottnerconsulting.ca
Tue Jul 18 13:57:40 MDT 2006


This works for me;
$ResultAll=$Search->FMFindAny();
list($key)=each($ResultAll['data']);
$TheRecID=strtok($key, ".");


I can't get this to work, did I miss type it or does it require the for 
each loop?
$ResultAll=$Search->FMFindAny();
list($TheRecID, $TheModID)=explode('.', $key($ResultAll['data']));





On Jul 18, 2006, at 3:09 PM, Gjermund Gusland Thorsen wrote:

> This is how I do it
> ---
> list( $recid, $modid ) = explode( '.', $key( $r['data'] ) );
> ---
>
> ggt667
>
> On 7/18/06, AC <ac at pottnerconsulting.ca> wrote:
>> > If you just want the key I believe this will work, but I haven't 
>> tried:
>> > list($key) = each($ResultAll['data']);
>> > $recid = strtok($key, ".");
>>
>> Yes it does work, thanks.
>>
>>
>>
>> On Jul 18, 2006, at 1:52 PM, Andrew Denman wrote:
>>
>> > Don't remember where I found this, but it's useful if you only have 
>> one
>> > record returned. The first line will give you the key and data of 
>> the
>> > first
>> > set of data in the $ResultAll['data'] array (and according to the 
>> php
>> > docs,
>> > advance the pointer to the next set of data).  Second and third 
>> lines
>> > will
>> > break out the recid and modid.
>> >
>> > list($key, $data) = each($ResultAll['data']);
>> > $recid = strtok($key, ".");
>> > $modid = strtok(".");
>> > $Field_Data = $data['Field_Name'][0];
>> >
>> > If you just want the key I believe this will work, but I haven't 
>> tried:
>> > list($key) = each($ResultAll['data']);
>> > $recid = strtok($key, ".");
>> > $modid = strtok(".");
>> >
>> > Andrew Denman
>> >
>> > -----Original Message-----
>> > From: fx.php_list-bounces at mail.iviking.org
>> > [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of AC
>> > Sent: Tuesday, July 18, 2006 12:30 PM
>> > To: fx.php_list at mail.iviking.org
>> > Subject: [FX.php List] Getting "-recid" for 1 record
>> >
>> > If I know that only 1 record is returned then I can use the 
>> following
>> > to get data from that record;
>> >
>> > $ResultAll=$Search->FMEdit();
>> > $ResultOne=current($ResultAll['data']);
>> > echo('ID=' . $ResultOne['ID'][0]);
>> >
>> >
>> >
>> > How would I do the same thing to get the "-recid" without doing the
>> > following loop thing?
>> >
>> > foreach($ResultAll['data'] as $key=>$ResultOne){
>> >     $TheRecIDModNum=explode('.',$key);
>> >     $TheRecID=$TheRecIDModNum[0];
>> > }
>> >
>> > _______________________________________________
>> > 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
>> >
>> >
>>
>> _______________________________________________
>> 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
>
>



More information about the FX.php_List mailing list