[FX.php List] modid, recid, and single record search results

Dale Bengston dbengston at preservationstudio.com
Wed Dec 12 12:00:41 MST 2007


Hi Jamie,

If you have one record (and you can find out by looking at foundCount,  
you can get past "knowing" the recid and the modid with something like  
this:

if ($returnedData['foundCount'] == 1)
	{
	$theRec = current($returnedData['data']);
	}

For more on the use of current() on arrays, take a look at

http://us2.php.net/manual/en/function.current.php

Hope this helps,
Dale

On Dec 12, 2007, at 12:45 PM, Jamie Adams wrote:

> Hello all,
>
> I have a script that pulls data on individual records.  It does a  
> search for the records primary key value in the primary key field.   
> And with any luck, finds one and only one record.  So my FMFind()  
> returns an array with all the usual stuff, and my single, solitary  
> record, to my $ReturnedData array.  So I should be able to get my  
> data in ReturnedData[‘data’], but I have to specify and record ID  
> and a mod ID.  I assume since there’s only one record in my found  
> set, my RecID is either 0 or 1.  But what’s my ModID?  I’m not  
> making any changes, so I just want the most current version.
>
> When I have multiple records returned, I do a  
> foreach($ReturnedData[‘data’] as $key=>$searchData), and then use  
> $searchData as my array of search results.  That works, but I never  
> really understood why.  And it seems wasteful and inefficient to use  
> the foreach() when I only have 1 record.  Is there another way?
>
> Jamie Adams
> ________________________________________________________
>
> Liquis, Inc.
>
> 400 Parker Drive, Suite 1110, Austin, TX 78728
> phone 512.299.9634, ext 103 -- fax 512.873.0575
> ________________________________________________________
>
> www.liquis.com
> www.auctionpartner.com
> www.furniture-partner.com
> eBay Store: http://stores.ebay.com/Auction-Partner-High-Tech-Equipment?refid=store
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20071212/a98276bb/attachment-0001.html


More information about the FX.php_List mailing list