Limit postgresql query results

Поиск
Список
Период
Сортировка
Искать

Limit postgresql query results

От:
"Blake Starkenburg" <blake_star@email.msn.com>
Дата:
Hello, I am using PostgreSQL 6.3 and PHP. I am trying to build a query that
only returns 20 results at a time, with a "next" link at the bottom of the
query results for the next 20. Someone suggested to me that I use the below
block of code (pg_Exec ($conn, "set QUERY_LIMIT='20'");). How would I use
this in the below code I'm already using to connect to and query the DB? And
does anyone maybe have any better ideas of going about this task?

CODE I WAS GIVEN TO USE
---------------------------------------------------------------------
pg_Exec ($conn, "set QUERY_LIMIT='20'");
---------------------------------------------------------------------

THE CODE I AM USING NOW
---------------------------------------------------------------------

---------------------------------------------------------------------

Thank you everyone for your help



Re: [GENERAL] Limit postgresql query results

От:
"Dan Wilson" <dan_wilson@geocities.com>
Дата:
Blake,

Try this:



Hope that helps.  You control everything with your for loop.  And you pass
the start and ending row in the URL.

-Dan



----- Original Message -----
From: Blake Starkenburg 
To: 
Sent: Monday, August 16, 1999 10:34 AM
Subject: [GENERAL] Limit postgresql query results


> Hello, I am using PostgreSQL 6.3 and PHP. I am trying to build a query
that
> only returns 20 results at a time, with a "next" link at the bottom of the
> query results for the next 20. Someone suggested to me that I use the
below
> block of code (pg_Exec ($conn, "set QUERY_LIMIT='20'");). How would I use
> this in the below code I'm already using to connect to and query the DB?
And
> does anyone maybe have any better ideas of going about this task?
>
> CODE I WAS GIVEN TO USE
> ---------------------------------------------------------------------
> pg_Exec ($conn, "set QUERY_LIMIT='20'");
> ---------------------------------------------------------------------
>
> THE CODE I AM USING NOW
> ---------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
>
> Thank you everyone for your help
>
>
>
>

FAQ