Frequently Asked Questions

How many files are in this form generator application?

About 270 files including language label files for phpMyEdit, various icons, a few examples, a fonts folder for glyphicons, and text file cheat sheets. Tested on WAMP and LAMP environments. Buyers essentially receive a copy of this website.

What do I have to do to install this application?

See Installation. Basically unpack the archive and set your database credentials in 3 files and it's ready to go. Works with multiple databases. The upper navbar will display a menu of scripts you've created. You'll probably want to do a View Source on the page and create some HTML to replace the auto-generated navigation drop-down located in the header include file. Basically edit the header include file and tweak the code for the navbar. If you have multiple databases then you'll want to code multiple drop downs for the navbar.

Why is this app wrapped in Twitter Bootstrap?

Twitter Bootstrap appears to be ideally flexible in terms of setting up responsive pages. The basic configuration here will display at a page width of about 1200 pixels wide on large displays, or about 800 pixels on smaller displays. Much of the page will scroll vertically when viewed on tablets and small displays (though the data TABLE may not). A configuration setting in each script makes it easy to set 100% page width (good for tables with a LOT of columns). Reduce the size of your browser window in order see how the pages will display on a tablet.

How do I add enable the date picker for individual fields?

In the local Javascript file, near the end of the file, locate an example using #PME_data_date_column. Basically all you have to do is copy the example for #PME_data_date_column and substitute the name of your date field. Note that all fields in the form are prefixed with PME_data_
$('#PME_data_YourColumnName').datepicker({ format: 'yyyy-mm-dd' });

One of my tables has 25 columns and all columns must be displayed. How do I make a script use 100% of the display width?

Open the script and set $omit_div_container = 1;. Make sure each field has the FL (filter and list) options enabled: 'options' => 'ACPVDFL',.

Why do my scripts contain comments like "// Bookmark: generator.steps.php at line 538"

If you want to change something about the way the scripts are generated, or add some PHP code, this will help you determine where to look.

What might I want to know about collation and character sets?

Collation affects string (text) sorting. This collation discussion suggests that most English users should select utf8_general_ci collation but that if accented characters prevail then utf8_unicode_ci might be a better choice.

Isn't phpMyEdit kind of old?

Let's call it mature. phpMyEdit matured and went out of active development about 6 years ago. phpMyEdit is faster and easier to implement than most alternatives. The class file included with this project has been updated with a few bug fixes and minor improvements. This app works fine for the 100+ websites running my custom content management system.

Would you install this application for me?

Probably. For a small fee. Contact . Consulting services and website hosting are also available.

Deleting records may be a bad idea

In some of the tables used for this demo the column `deleted` enum('0','1') NOT NULL DEFAULT '0' causes several things to happen.

When the phpMyEdit script is created, a filter is added:

$opts['filters'] = 'PMEtable0.deleted = "0"';

And a trigger is added:

$opts['triggers']['delete']['before'] = 'inc/triggers/mark_as_deleted.TDB.php';

Users should then edit the script and comment out the array for the `deleted` field.

/*
$opts['fdd']['deleted'] = array(
  'default'    => 0,
  'input'      => '',
  'maxlen|ACP'     => 1,
  'name'       => 'Deleted',
  'options'    => 'ACP',
  'select'     => 'D',
  'sqlw'       => 'TRIM("$val_as")',
  'values2'    => array('0' => 'No', '1' => 'Yes'),
  'sort'       => true
);
*/

If a record is subsequently deleted, the value of the `deleted` field is changed (by the trigger) to 1. That record no longer appears in List mode because of the filter. The record still exists but is filtered out.

phpMyAdmin or a similar utility could subsequently be used to change the `deleted` flag to 0, which is approximately like un-deleting the record. Or, temporarily un-comment the array for the `deleted` field and set the flag back to 0.

// triggers/mark_as_deleted.TDB.php
/*
Variables available within triggers include the following.
$this             object reference
$this->dbh        initialized MySQL database handle
$this->key        primary key name
$this->key_type   primary key type
$this->key_delim  primary key deliminator
$this->rec        primary key value (update and delete only)
$newvals          associative array of new values (update and insert only)
$oldvals          associative array of old values (update and delete only)
$changed          array of keys with changed values
*/
$query2 = sprintf('UPDATE %s SET `deleted` = "1" WHERE `%s` = "%s" LIMIT 1', $this->tb, $this->key, $this->rec);
if($this->MyQuery($query2)){
   // Emulate the change_log function, saving a copy of the record flagged as deleted
   if($this->logtable){
      $query3 = sprintf('INSERT INTO %s' .' (updated, user, host, operation, tab, rowkey, col, oldval, newval)' 
         .' VALUES (NOW(), "%s", "%s", "delete", "%s", "%s", "%s", "%s", "")', $this->logtable, addslashes($this->get_server_var('REMOTE_USER')), addslashes($this->get_server_var('REMOTE_ADDR')), addslashes($this->tb), addslashes($this->rec), addslashes($key), addslashes(serialize($oldvals)));
      $this->myquery($query3, __LINE__);
   }
   return false;
}else{
   abort('Error in trigger '.__FILE__.' used to flag a record as deleted: '.mysqli_error());
}

When implementing the above, be sure to test for the desired result before uploading to the production server!

An additional explanation of using a `deleted` field appears at the end of the Installation instructions.