The query is executed AFTER an operation.
But there are different SQLQueries.
Normal / Successfully mode - After complete (good) transfer
And ERR_ after problems - e.g. transfer aborted.
Example:
#Good Case Logging
SQLLog * history
SQLNamedQuery history INSERT "'%U', '%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'ok', NULL" ftp_history
#Faulty Case Logging
SQLLOG ERR_* history_err
SQLNamedQuery history_err INSERT "'%U', '%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'nicht ok', NULL" ftp_history
USE ftpserver;
#
# Table structure for table 'benutzer'
#
DROP TABLE IF EXISTS benutzer;
CREATE TABLE `benutzer` (
`ID` int(11) unsigned NOT NULL auto_increment,
`owner_id` int(11) unsigned NOT NULL default '0',
`gid` tinyint(3) unsigned default '1',
`beschreibung` text,
`loginname` varchar(30) NOT NULL default '',
`passwort` varchar(16) NOT NULL default '',
`verzeichnis` varchar(255) NOT NULL default '/',
`anmerkung` text,
`login_count` int(10) unsigned default '0',
`add_datum` datetime default NULL,
`gueltig_bis` datetime default NULL,
`last_login` datetime default NULL,
`active` set('on','off') default 'on',
`hidden` set('true','false') NOT NULL default 'false',
`deleted` set('true','false') NOT NULL default 'false',
PRIMARY KEY (`ID`),
UNIQUE KEY `Login` (`loginname`)
) TYPE=MyISAM COMMENT='FTP-Benutzer';
#
# Table structure for table 'gruppen'
#
DROP TABLE IF EXISTS gruppen;
CREATE TABLE `gruppen` (
`ID` tinyint(3) unsigned NOT NULL auto_increment,
`name` varchar(16) NOT NULL default '',
`mitglieder` text,
`basedir` varchar(30) default NULL,
UNIQUE KEY `ID` (`ID`,`name`)
) TYPE=MyISAM COMMENT='FTP-Benutzergruppen';
#
# Table structure for table 'history'
#
DROP TABLE IF EXISTS history;
CREATE TABLE `history` (
`loginname` varchar(30) default NULL,
`filename` text,
`size` bigint(20) default NULL,
`host` varchar(80) default NULL,
`ip` varchar(16) default NULL,
`aktion` varchar(255) default NULL,
`dauer` varchar(10) default NULL,
`zeit_lokal` datetime default NULL,
`status` set('ok','nicht ok') default NULL,
`ui` bigint(20) NOT NULL auto_increment,
PRIMARY KEY (`ui`)
) TYPE=MyISAM COMMENT='FTP-Befehlshistory';