Re: Misleading API documentation for DB_Pager
| From: | Pierre-Alain Joye | Date: | Tue, 16 Jul 2002 11:57:05 +0000 |
| Subject: | Re: Misleading API documentation for DB_Pager | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7744@lists.php.net to get a copy of this message | ||
On Tue, 16 Jul 2002 13:09:06 +0200
"Martin Jansen" <mail@martin-jansen.de> wrote:
> The API documentation for DB_Pager::getData is misleading:
>
> "'lastpage' => X, // the row number where the last page starts"
>
> stands in contradiction to the code, where lastpage is the result of
>
> "ceil($numrows/$limits)".
>
> This operation actually calculates the number of pages for the result set,
> but it does *not* calculate the number of first row that is display on the
> last page.
Arnaud has already posted ( and tomas confirm it, need a doc update ).
In fact, remove the "deprecated" tag in build method.
now there s 2 ways to use db_pager, as shown in the current doc, or using the old way, and adding a
total pages counter to a session or by a get method. The total pages is set by a select count(*)
launched on time during the first call.
hth
pa