Primary Key Considerations
This application expects MySQL column number 0 to be the primary key column (or unique identifier) in each table.
This application does *not* work with tables containing multiple keys. If your Primary Key column is always column 0, please disregard the following information.
Most people make the first column the primary key (MySQL column 0) which is the scenario for which these scripts are intended. Each MySQL table must contain a Primary Key column or a column containing a unique identifier.
(1.) If your primary keys are different column numbers in different tables a warning message will appear when that form is loaded. You will then need to edit the form, specify the primary key column name and column type, and remove the embedded warning message.
(2.) If the primary key in your tables is always the same column number, but not MySQL column number 0, two items in the main script will have to be changed. // Replace 0 with the correct column number. if($j == 0) $hack_key = $fd; if($j == 0) $hack_key_type = @mysql_field_type($fds, $j);
(3.) If the primary key is a DIFFERENT COLUMN NUMBER IN MANY TABLES, a switch() statement could be configured to work around this problem.
Avoid using hyphens in the names of databases, tables, or column names. Use the underscore character instead! Depending on how your PHP code is quoted, a hyphen can sometimes be interpreted as a minus sign, crashing the script.
View the Demo (new window).
PHP Form Generator Home
| PHP Form Generator Demo
|