Re: timezone - Mailing list pgsql-php

From Josh Berkus
Subject Re: timezone
Date
Msg-id 200208011209.19576.josh@agliodbs.com
Whole thread Raw
In response to timezone  (angelo.rigo@globo.com)
Responses Re: timezone  (angelo.rigo@globo.com)
List pgsql-php
Angelo,

> how can i display 20 results at a time and give a link to the next 20 or
> 50 or whatever records i do have on the database?

Use LIMIT and OFFSET, which work the same in Postgres and MySQL:

SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
 FROM aprovados
 ORDER BY nome ASC
 LIMIT 20 OFFSET 0;

then

SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
 FROM aprovados
 ORDER BY nome ASC
 LIMIT 20 OFFSET 20;

etc.

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology     josh@agliodbs.com
    and data management solutions     (415) 565-7293
   for law firms, small businesses      fax 621-2533
    and non-profit organizations.     San Francisco


pgsql-php by date:

Previous
From: Josh Berkus
Date:
Subject: Re: timezone
Next
From: angelo.rigo@globo.com
Date:
Subject: Re: timezone