[Solar-talk] limit in select

Rodrigo Moraes rodrigo.moraes at gmail.com
Wed Jul 26 08:23:01 PDT 2006


On 7/26/06, Jeff Surgeson wrote:
> Yes but that is to set the number of rows displayed per page, not so? I want
> to limit the total number of rows returned by using ->limit()

But that's what limit() is supposed to do - set the number of rows
displayed per page, and the offset (which for us is the 'page'
setting). Wait... ah, changing the paging option will change the
number of pages? So hmm, yes, maybe they are not the same thing...

Anyway, you can't use fetchAll()->...->limit() because fetchAll()
returns a Rowset object. You can make add a method to bd_news class to
create a select and add limit to it, or, better, if you use this
often, make a base class that extends Solar_Sql_Table and always
extend it instead. Then you can add custom methods or convenience
methods that you use often.

rodrigo


More information about the solar-talk mailing list