RE: [PHP] Re: Pagination Optimization

2005-01-18 Thread yangshiqi
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: > > === >

Re: [PHP] Re: Pagination Optimization

2005-01-08 Thread Curt Zirzow
* 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

Re: [PHP] Re: Pagination Optimization

2005-01-08 Thread M. Sokolewicz
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($

Re: [PHP] Re: Pagination Optimization

2005-01-08 Thread Bruno B B Magalhães
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();

[PHP] Re: Pagination Optimization

2005-01-07 Thread M. Sokolewicz
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