Database Change Log
The changelog feature built into phpMyEdit is very nice. If configured individually in your forms, one changelog table will record the old and new values when records are updated or deleted. Storage of these values affords a degree of disaster recovery. Schema follows:
CREATE TABLE `change_log` (
`id` mediumint() NOT NULL auto_increment,
`updated` timestamp(14) NULL,
`user` varchar(50) NOT NULL default '',
`host` varchar(255) NOT NULL default '',
`operation` varchar(50) NOT NULL default '',
`tab` varchar(50) NOT NULL default '',
`rowkey` varchar(255) NOT NULL default '',
`col` varchar(255) NOT NULL default '',
`oldval` text,
`newval` text,
PRIMARY KEY (`id`),
KEY `tab` (`tab`),
KEY `col` (`col`),
KEY `updated` (`updated`)
) TYPE=MyISAM ;
Changelog "user" value is extracted in the following order:
$_SERVER['REMOTE_USER']
$HTTP_SERVER_VARS['REMOTE_USER']
$REMOTE_USER
Changelog "host" value is extracted in the following order:
$_SERVER['REMOTE_ADDR']
$HTTP_SERVER_VARS['REMOTE_ADDR']
$REMOTE_ADDR
Near the top of your form, be sure to set:
$opts['logtable'] = 'change_log';
PHP Form Generator Home
| PHP Form Generator Demo
|