Re: [newbie] simple browse / edit form in PHP - Mailing list pgsql-php

From Chris
Subject Re: [newbie] simple browse / edit form in PHP
Date
Msg-id 5.1.0.14.0.20020315084826.02525470@cooee.cybersydney.com.au
Whole thread Raw
In response to [newbie] simple browse / edit form in PHP  ("Jules Alberts" <julesa@arbodienst-limburg.nl>)
List pgsql-php
Hi,

>i have a test setup with postgresql 7.2, PHP 4, and apache. everything
>works fine, PHP generates HTML pages with query results in it. now i
>want to create a simple form which shows the current record, and has
>these buttons:
>
>- previous, first, next, last record
>- delete record
>- add record
>
>it sounds very simple, but where do i start? i guess i should make a
>stateless connection (the form will be accessed via the web). i figure
>i need some sort of recordset, is a CURSOR the right approach? maybe
>someone can point me to an example?

For the previous / next buttons, I use 'LIMIT / OFFSET' with the queries.

For example to show 10 records each page,
on the first page:

query = SELECT ..... LIMIT 10 OFFSET 0

the second page:

query = SELECT ..... LIMIT 10 OFFSET 10

etc

For adding or deleting a record, you'll have to do up a form of some type
to get the data.

I'll leave the practicalities to you :)


-----------------
      Chris Smith
http://www.squiz.net/


pgsql-php by date:

Previous
From: Marcelo Pereira
Date:
Subject: Re: Graphics
Next
From: Gurudutt
Date:
Subject: Re: Graphics