09, 2005 2:37 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: Pagination Optimization
* Thus wrote Bruno B B Magalhes:
> Thanks for your help, in fact helped a lot... Now my function only
> performs 2 queries, here it is:
>
> ===
>
* Thus wrote Bruno B B Magalhes:
> Thanks for your help, in fact helped a lot... Now my function only
> performs 2 queries, here it is:
>
> ===
> function fetch_paginated($query='',$page=1,$itens=20)
> {
> $this->query($query);
This h
and now a few small comments to your code ;)
Bruno B B Magalhães wrote:
Thanks for your help, in fact helped a lot... Now my function only
performs 2 queries, here it is:
===
function fetch_paginated($query='',$page=1,$itens=20)
{
$this->query($
Thanks for your help, in fact helped a lot... Now my function only
performs 2 queries, here it is:
===
function fetch_paginated($query='',$page=1,$itens=20)
{
$this->query($query);
$total_rows = $this->num_rows();
first of all, you're running 4 queries here. 4 queries is a lot!
Especially when you don't need more than 2 ;)
the problem here is that your queries are pretty "unknown" to this
function. Although it does a nice result for that unknowing, there's a
few minor things that make it faster.
First of
5 matches
Mail list logo