Re: [newbie] simple browse / edit form in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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/



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux