Re: Create PHP form from MySQL table structure

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

 



On Sun, Dec 21, 2008 at 7:24 PM, tedd <tedd.sperling@xxxxxxxxx> wrote:

> At 10:35 AM +0000 12/21/08, R B MacGregor wrote:
>
>> Hi folks
>>
>> Anybody got any recommendations for a utility which would create a quick
>> head
>> start by creating the php/html code for a basic form using the field
>> structure
>> of a MySQL table ?
>>
>> Thanks for any suggestions.
>>
>> --
>> Ronnie MacGregor
>> Scotland
>>
>> Ronnie at
>> dBASEdeveloper
>> dot co dot uk
>>
>
>
> Interesting.
>
> I am sure that one can write a script to find all the fields in a table and
> create a form from that. However, I don't know of any utility that does
> that.
>
> Hope that helps,
>
> tedd



I wrote a class for my upcoming opensource cms ( aikicms ) , that can handle
an array of added value description of a db table, and convert it into forms
for inserting, and editing.

the array looks like this:


 $insertArray= array(
 "tablename" => "aiki_something",
 "pkey" => "id",
 "selection1" => "cityid:NAME:aikiads_cities:id:cities",  //values form
other table: aikiads_cities
 "textinput1" => "name:NAME",
 "textblock" => "bodytext:NAME",
 "upload" =>
"filename:NAME:jpg:resize:640|n_|75|s_:/home/paintings:/home/paintings/s_",
 "staticselect" => "staticname:NAME:letters",
 "staticselect" => "staticname:NAME:date_years:2002-2008",
 "imagefolderupload" =>
"filedname:NAME:jpg:resize:640|n_|75|s_:/home/paintings:/home/paintings/s_",
 );

the values of this method instead of just walking throw each filed and
putting a text block for it, that the class can automatically generate
upload forms with image resizing and stored procedures of linked tables
inside mysql..

I think you'll understand what I mean by just looking to the array, the code
will be available soon under GPL,
if anyone is interesting I can send the beta class source for further
improvement,

 maybe adding a function that can find each field of a table and Hey that's
a text filed just add:
 "textinput1" => "name:NAME",

then the class will build the form for you

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux