[FX.php List] Get Last Record
Dale Bengston
dbengston at tds.net
Fri Dec 4 11:44:29 MST 2009
I'd sort by the table's key field descending (assuming it's incremental & sequential) and set the found set to one record. The last record is the one at the bottom, er top.
One thing to look out for: in a busy, multi-user environment: the last record may not be the last record *you* created. A way to defend against this would be to include the user's id or session id or some other data stored in that "last record" makes sure you get the last record you created.
Dale
On Dec 4, 2009, at 10:08 AM, Jonathan Schwartz wrote:
> I used method 2. Single query. Works great. Nice to know if there is a specific command, though.
>
> Jonathan
>
>
>> Hi Folks,
>>
>> OK. I admit to being lazy on this, posting my question rather than researching for 2 hours....how do you retrieve just the last record in a file in an efficient manner?
>>
>> I thought of the following:
>> 1) Do an initial query. Get last foreach. But that makes all records transfer.
>> 2) Do a single record query that contains a related record with reverse sort. Get from portal
>>
>> Isn't there a get last record parameter?
>>
>> 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
>
>
> --
> 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