[Catalyst] Sort - ORDER BY

Matt S Trout dbix-class at trout.me.uk
Tue Nov 8 20:54:42 CET 2005


On Tue, Nov 08, 2005 at 11:28:51AM -0800, Will Smith wrote:
> thanks, i use DBI::RetrieveAll, which gave me error (could not find the sql)
> then I use the DBI::Sweet , no error but the result is not right
>  
> use Class::DBI::Sweet;
> ...
> $c->stash->{myartist} = cd::M::CDBI::Artist->retrieve_all( order_by => 'name' );
> ....
> Then on my template I have:
> [% WHILE (artist= myartist.next) %]
> [% artist.name %]<br>
> [% END %]
>  
> the result is not sorted. I just wonder where i am wrong.

Try

cd::M::CDBI::Artist->search({}, { order_by => 'name' });

-- 
     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list