Re: using LIMIT

From: Date: Sun, 08 Apr 2001 16:38:40 +0000
Subject: Re: using LIMIT
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-8358@lists.php.net to get a copy of this message
On Sun, Apr 08, 2001 at 02:09:04AM -0300, Manuel Lemos wrote: > Hello Sharmad, > > On 06-Apr-01 08:33:54, you wrote: > > >Hi, > > Thanks for firstly helping me out with the prevoius query. > > I have a database with mem_id(int) and name(text) as its fields. > > In the first form (HTML) ,I take mem_id,name and count(used for LIMIT) > > from the browser. > > > In the second query i write a query whereby i say > >$result=pg_Exec($database,"SELECT mem_id,name from search LIMIT $count"); > > Now here i display the the first 10(say $count=10) records. > > Now I know to display the other records i can say > >$result=pg_Exec($database,"SELECT mem_id,name from search LIMIT > >$count,$count"); > > but what condition to give to display pages of more than $count records > > i.e how do i give for next existing page. > > What you need to do is to pass to the LIMIT clause the $first and $limit > values where the $first is the number of the page of results you want to > display times the number records you want to see per page which is also the > $limit. > > Maybe you want to look at Metabase which is a PHP database abstraction page > that lets you specify the range of rows that you want to retrieve pretty > much like the LIMIT clause, except that it works well in all supported > databases including PostgreSQL versions that did not support the LIMIT > clause. > > http://phpclasses.UpperDesign.com/browse.html/package/20 > > With Metabase you may use this other PHP query result table display class > that is able to display query result rows in HTML tables with optional > links to go to the next, previous, first, last, etc... result pages. It > uses MetabaseSetSelectedRowRange($database,$first,$limit) function to > choose the rows that it displays in each page. > Thanks sir, This information will surely be helpful for me in future.but right now my Q +is that using LIMIT function how can I display multiple answers. It would be better if any reference of a made search engine would be given. -Regards -- The secret of the universe is @*&í!'ñ^#+ NO CARRIER __ _ _ _ _ |_|_||_||_||\/||_|| \ _|| || || \| || ||_/

« previous php.db (#8358) next »