Re: dynamic forms

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

 



On Tue, 1 Apr 2003 20:21:57 -0600
massimo <sub0@speakeasy.net> wrote:

> hey everyone,
> 
> I have this select form which get filled dynamically with all my
> tables in my database. It depends on which one I choose from the drop
> down menu, that clicking submit it displays the right table..
> now, I need to have a form on the page that would let me insert new 
> records. Of course I don't want to make a form for each table, so I 
> would like to change the entries and values of the insert form in 
> relation to the table I choose from the drop down form above
> mentioned. Of course the "id" and "created" are NULL because they
> should get filled automatically.
> 
> thanks for your help.
> 
> mas


Mas,

We recently did something very similar to this for a client.

One approach that you could take is to parse the results from "describe
table_name" (that statement is for Mysql but similar things can usually
be done for other database engines) for the table selected in the List
control.

This really is fairly straight forward.

You have isolated the table name that you are interested in... Great
Execute a database query to get the field description for the table.

Decide what action you wish to take for each field.
For example, radio buttons for an enum field, hidden for a primary key
and created by.


George


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux