Best Web Host

phpMyEdit example

MySQL™ table editor

Filename: phpvs_sakila.film_text.php

Page: 1 of 100  Records: 998
Film ID Title Description
Clear Sorted By: Film ID ascending
View Change Copy Delete 2 ACE GOLDFINGER A Astounding Epistle of a Database Administrato...
View Change Copy Delete 3 ADAPTATION HOLES An Astounding Reflection of a Lumberjack And a ...
View Change Copy Delete 4 AFFAIR PREJUDICE A Fanciful Documentary of a Frisbee And a Lumbe...
View Change Copy Delete 5 AFRICAN EGG A Fast-Paced Documentary of a Pastry Chef And a...
View Change Copy Delete 6 AGENT TRUMAN A Intrepid Panorama of a Robot And a Boy who mu...
View Change Copy Delete 7 AIRPLANE SIERRA A Touching Saga of a Hunter And a Butler who mu...
View Change Copy Delete 8 AIRPORT POLLOCK A Epic Tale of a Moose And a Girl who must Conf...
View Change Copy Delete 9 ALABAMA DEVIL A Thoughtful Panorama of a Database Administrat...
View Change Copy Delete 10 ALADDIN CALENDAR A Action-Packed Tale of a Man And a Lumberjack ...
View Change Copy Delete 12 ALASKA PHANTOM A Fanciful Saga of a Hunter And a Pastry Chef w...
Page: 1 of 100  Records: 998

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. cPanel PHP MySQL web hosting


phpMyEdit code created for the above table.

<?php

/*
 * Database: phpvs_sakila
 * Table: film_text
 * Row count: 998
 * Column count: 3
 * Filename: phpvs_sakila.film_text.php
 * Created Wed, 22 Feb 2012 02:45:08 -0700
 * Primary key: film_id
 * Null fields: description
 * Multi-key fields: title
 * All fields: film_id, title, description
*/

$opts['tb'] = 'film_text';

// 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('film_id');

$opts['key'] = 'film_id';

$opts['key_type'] = 'int';

$opts['options'] = 'ACPVDFL';

// $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 3 columns


// Begin phpMyEdit field arrays

// No auto_increment field?

// column 0: `film_id` int - smallint(6)
// flags: not_null, primary_key
$opts['fdd']['film_id'] = array(
  
'css'        => array('postfix' => 'right-justify'),
  
'default'    => '',
  
'help|ACP'   => 'No auto_increment flag found.',
  
'input'      => '',
  
'maxlen'     => 6,
  
'name'       => 'Film ID',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size'       => 6,
  
'sort'       => true
);
// If the tab feature is implemented, the first column must have a tab
// $opts['fdd']['film_id']['tab|ACP'] = 'Film ID';


// column 1: `title` string - varchar(255)
// flags: multiple_key, not_null
// collation: utf8_general_ci
$opts['fdd']['title'] = array(
  
'default'    => '',
  
'help|ACP'   => 'Limit 255 characters',
  
'input'      => '',
  
'maxlen'     => 255,
  
'name'       => 'Title',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'size'       => 80,
  
'sqlw'       => 'TRIM("$val_as")',
  
'sort'       => true
);
$opts['fdd']['title']['js']['required'] = true;
$opts['fdd']['title']['js']['hint'] = 'An entry is required for Title';


// column 2: `description` blob - text
// flags: blob
// collation: utf8_general_ci
$opts['fdd']['description'] = array(
  
'default'    => '',
  
'help|ACP'   => 'Limit 65,535 characters',
  
'input'      => '',
  
'maxlen'     => 65535,
  
'name'       => 'Description',
  
'options'    => 'ACPVDFL',
  
'select'     => 'T',
  
'sqlw'       => 'IF($val_qas = "", NULL, $val_qas)',
  
'strip_tags|FL' => true,
  
'textarea'   => array('rows' => 20'cols' => 80),
  
'trimlen|FL' => 50,
  
'sort'       => false
);
$opts['fdd']['description']['js']['required'] = true;
$opts['fdd']['description']['js']['hint'] = 'An entry is required for Description';

require_once(
'./resources/inc/phpMyEdit.class.new.php');

new 
phpMyEdit($opts);

require_once(
'./resources/inc/footer.php');

?>


cPanel PHP MySQL web hosting

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.