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.
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]