barrycarlyon has asked for the wisdom of the Perl Monks concerning the following question:

Given the following code
sub _newstuff{return LSRfm::Database::Data->search(field => 'newstuff' +, { order_by=>'date' });}
I wish to order the items by earliest first ie, date DESC, i tried putting DESC after but it crashed my site
sub _newstuff{return LSRfm::Database::Data->search(field => 'newstuff' +, { order_by=>'date' DESC});}
What is the correct way to do the above?

Yours

Barry Carlyon

2006-04-05 Retitled by planetscape, as per Monastery guidelines
Original title: 'SOLVED!!! Post Ordering'

Replies are listed 'Best First'.
Re: Post Ordering
by jeffa (Bishop) on Apr 04, 2006 at 13:55 UTC
Re: Post Ordering
by ptum (Priest) on Apr 04, 2006 at 13:59 UTC

    I don't see that package in CPAN (LSRfm::Database::Data) ... is this something homegrown? I would suggest you get your hands on the source and check the search method for optional arguments.


    No good deed goes unpunished. -- (attributed to) Oscar Wilde
Re: Post Ordering
by ptum (Priest) on Apr 04, 2006 at 15:24 UTC

    When updating a node with a solution, you may wish to simply add an Update: section near the top of the original node's text, and explain the solution/workaround/blinding- flash-that-obviates-the-need-for-a-solution for those who might have a similar problem. Note that changes to the title aren't automatically rolled down to any prior responses, which can cause confusion.

    Welcome to the Monastery! :)


    No good deed goes unpunished. -- (attributed to) Oscar Wilde