Re: Web page paginator that doesn't rely on the LIMIT clause

From: Date: Tue, 03 Aug 2004 20:02:27 +0000
Subject: Re: Web page paginator that doesn't rely on the LIMIT clause
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35545@lists.php.net to get a copy of this message
That will take alot of resources, but if you only want 20 then make a variable to count, $i or so, $++; each time it goes through, after 20 make it stop the script. "Ross Honniball" <ross@bookshop.jcu.edu.au> wrote in message news:6.0.0.22.1.20040803184213.01e40238@bookshop2.jcu.edu.au... > Hi all, > > I use the LIMIT statement to control paging of data, which works really well. > > I now have a situation where I need to use some logic in addition to the > query that will result in NOT ALL records being spat out. ie. > > select * from x where y; > foreach result > if (some condition) > output; > endif > endfor > > So problem is I can't say LIMIT 20,20 on the query as logic may result in > less than 20 records being spat out to screen. > > I was planning on coding up a solution so that i just keep a count myself > of how many records I have output myself and break at appropriate paging > points, but I am probably re-inventing the wheel. > > Anyone know of any good classes they are using that do this sort of thing > already? > . > . Ross Honniball. JCU Bookshop Cairns, Qld, Australia. > .

« previous php.db (#35545) next »