Data appearing below is compiled from a MySQL VIEW (a view is essentially a stored query; options restricted to VFL)
Tables containing more than 'n' columns are configured to display the first 'n' columns and display links to toggle (add/remove) the remaining columns.
Users are advised to use phpMyAdmin to set an INDEX for columns which are often sorted/searched. Most web hosts provide phpMyAdmin in the website control panel.
Try Hostgator.com for excellent web hosting with cPanel, PHP, MySQL™ and many other features. ![]()
<?php
/*
* Database: phpvs_sakila
* View: actor_info
* Row count: 202
* Column count: 4
* Filename: phpvs_sakila.actor_info.php
* Created Wed, 22 Feb 2012 22:00:54 -0700
* Null fields: film_info
* All fields: actor_id, first_name, last_name, film_info
*/
$opts['tb'] = 'actor_info';
// phpMyEdit common variables + a few functions + UTF8 database connection
require_once('./resources/inc/config.php');
require_once('./resources/inc/header.php');
// Use phpMyAdmin to apply an INDEX to columns which are frequently sorted/searched.
// Prepending a minus sign (-) to a sort_field value causes DESCending sort order.
$opts['sort_field'] = array('actor_id');
$opts['key'] = 'actor_id';
$opts['key_type'] = 'int';
// A VIEW is a stored SELECT query, not a MyISAM table.
// Un-editable. Need to do more research on how this might be made editable.
$opts['options'] = 'VFL'; // ACPVDFL
echo "\n".'<p>Data appearing below is compiled from a MySQL VIEW (a view is essentially a stored query; options restricted to VFL)</p>';
// $opts['triggers']['insert']['after'] = 'resources/inc/triggers/view_rec_after_add.php';
if(empty($list_mode_status)){
// List mode
}elseif(isset($_REQUEST['PME_sys_operation']) || isset($_REQUEST['PME_sys_moreadd']) && isset($_REQUEST['PME_sys_morechange'])){
// 7 diffenent button clicks may occur
// PME_sys_operation: Add, PME_op_Change, PME_op_Copy, PME_op_Delete, PME_op_View
// PME_sys_moreadd: More
// PME_sys_morechange: Apply
}
// Toggle preference disabled given only 4 columns
// Begin phpMyEdit field arrays
// No auto_increment field?
// column 0: `actor_id` int - smallint(5) unsigned
// flags: not_null, unsigned
$opts['fdd']['actor_id'] = array(
'css' => array('postfix' => 'right-justify'),
'default' => 0,
'help|ACP' => 'No auto_increment flag found.',
'input' => '',
'maxlen' => 5,
'name' => 'Actor ID',
'options' => 'ACPVDFL',
'select' => 'T',
'size' => 5,
'sort' => true
);
// If the tab feature is implemented, the first column must have a tab
// $opts['fdd']['actor_id']['tab|ACP'] = 'Actor ID';
// column 1: `first_name` string - varchar(45)
// flags: not_null
// collation: utf8_general_ci
$opts['fdd']['first_name'] = array(
'default' => '',
'input' => '',
'maxlen' => 45,
'name' => 'First Name',
'options' => 'ACPVDFL',
'select' => 'T',
'size' => 45,
'sqlw' => 'TRIM("$val_as")',
'sort' => true
);
// column 2: `last_name` string - varchar(45)
// flags: not_null
// collation: utf8_general_ci
$opts['fdd']['last_name'] = array(
'default' => '',
'input' => '',
'maxlen' => 45,
'name' => 'Last Name',
'options' => 'ACPVDFL',
'select' => 'T',
'size' => 45,
'sqlw' => 'TRIM("$val_as")',
'sort' => true
);
// column 3: `film_info` string - varchar(341)
// collation: utf8_general_ci
$opts['fdd']['film_info'] = array(
'default' => '',
'input' => '',
'maxlen' => 341,
'name' => 'Film Info',
'options' => 'ACPVDFL',
'select' => 'T',
'size' => 80,
'sqlw' => 'IF($val_qas = "", NULL, $val_qas)',
'sort' => true
);
require_once('./resources/inc/phpMyEdit.class.new.php');
new phpMyEdit($opts);
require_once('./resources/inc/footer.php');
?>
If you have pre-purchase questions, please call Doug Hockinson at (720) 334-7850 or send email to doug@hockinson.com.
Data used for this demo is a modified version of Sakila schema (converted to MyISAM type tables)
Related sites: php-form-generator.com | phpvs.com | hockinson.com | denvermetro.org
Content management system with built in photo galleries and phpMyEdit form generator: www.phpvs.com/cms2011/
Regarding the style sheet used by these scripts,
un-comment some CSS code for body and wrapper in
order to match the layout of the generator script.
In page modes Add, Change, and coPy, note the Help
text displayed beside the fields. Several configurable
options are available: character limit, link to Help popup,
code supplied but commented out (no value), display "Entry Required", or MySQL Column Comment.