FORMfields, the premiere web framework
Support Home | Knowledge Base | Documentation | Forums | Contact Us
FORMfields & FORMgen :: Generated Forms

Generating a FORMfields Form and Control Panel From an Existing Database Table

(2214 views. Last Updated: 2007-08-08 7:31 PM)

Here is how to generate a form and control panel from an existing database table:
(It is very helpful to have PHPMyAdmin installed on your web server for the following)

1. Ensure that your database table has the following attributes:

a. Field: ff_id
Type: int(10)
Attributes: UNSIGNED
Null: No
Extra: auto_increment

b. Field: ff_inserted_on
Type: datetime
Null: No

c. Field: ff_timestamp
Type: timestamp
Null: Yes

-- Make sure to add these fields if they are missing from your table.

2. Then use FORMgen to create a form from scratch. For all the remaining attributes in your table (not ff_id, ff_inserted_on or ff_timestamp) do the following:
a. Create a new field with a field name exactly equal to the attribute name that is already in your database.
b. Select a FORMfields type that best matches each attribute.

3. Generate your form and only download the form and Control Panel. You may have to use a trial and error process to tweak the field names and types in FORMgen.

4. Use phpMyAdmin to copy your database table to value of FF_FORM_NAME in your generated Control Panel. For example if your Control Panel has:
define("FF_FORM_NAME", "adoctors");
then rename your table to adoctors.
Note: We recommend copying instead of renaming as this provides a backup.
Support | Earn Money
Copyright © 2005-2020 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.