Re: Parsing Data, Table to Form

Поиск
Список
Период
Сортировка
От brew@theMode.com
Тема Re: Parsing Data, Table to Form
Дата
Msg-id Pine.BSF.4.58.0405091137350.39457@themode.com
обсуждение исходный текст
Ответ на Parsing Data, Table to Form  ("Yasmine Kedoo" <yazkedoo@hotmail.com>)
Список pgsql-php
Yaz......

> i want to be able to display the table information in editable form
> fields, so that the data may be altered and the database updated.

If by table information, you mean the information contained in the table,
then what I do is get one row's data and load it into variables.  I use
the variables as the default text in the form (check the html standard).
After the user makes any edits he updates the entire row.

This only works with text boxes, with radio buttons and on/off buttons you
have to generate different html depending on the existing button state.

It's not complicated, just tedious to code if it has lots of buttons.  If
it's only text it's easier.  I think I started with an example someone
posted on php.net, maybe you can search for that and use it for reference,
too.  I think it has a subroutine to generate the buttons preselected by
the existing state of the database.

My script is long, involving switches to display the possible rows to be
edited for a user on the first pass, then displaying the info for the row
selected in an editable form, then updating (or inserting the row if it
doesn't exist) and going back to displaying all the possible rows for that
user. I have to study it for a while myself, remembering how it works
before I make any changes to it!  Hopefully somebody else has a more basic
example.

If by table information you mean the definition of a table in the
database, then that would be diferent, although still involving somewhat
the same type of script, just working on different database information.
All my table definitions are static in my database, so I've never done it
from a script, though.

brew

 ==========================================================================
                  Strange Brew   (brew@theMode.com)
     Check out my Musician's Online Database Exchange (The MODE Pages)
                        http://www.TheMode.com
 ==========================================================================


В списке pgsql-php по дате отправления:

Предыдущее
От: "Gavin M. Roy"
Дата:
Сообщение: Re: Parsing Data, Table to Form
Следующее
От: "Yasmine Kedoo"
Дата:
Сообщение: Re: Parsing Data, Table to Form