trimlen, display substr(,0,trimlen-3).'...' ['width'] is an optional display width specification for the column, e.g. ['width'] = '100px'; or $fdd['colname']['width'] = ($fdd['colname']['trimlen'] * 8).'px'; ['nowrap'] true or false. whether this field should get a NOWRAP ['mask'] a string that is used by sprintf() to format field output ['datemask'] a string that is used by date() to format date fields see PHP's date() for valid formatting characters ['daterange'] a of numbers ['daterange']['start'] = 1996; ['daterange']['end'] = $fdd['colname']['daterange']['start']+20; ['URL'] is used to make a field 'clickable' in the display, e.g.: ['URL'] = 'mailto:' or ['URL'] = 'http://'; ['URL'] = '$page?stuff'; Note that the following are available as variables: $key key field for record $name name of the field $value value of the field $page this HTML page $row mysql_fetch_assoc() for this row ['required'] = true will generate javascript to prevent null entries by users ['options'] is an optional parameter to control whether a field is displayed in the A(dd), C(hange), D(elete), view, or L(ist) views ['options']='R' indicates that a field is read only ['options']='P' indicates that a field is a password field ['options']='H' indicates that a field is to be hidden and marked as hidden ['textarea']['rows'] and/or ['textarea']['cols'] specifies a textarea is to be used to give multi-line input, e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10 ['values'] restricts user input to the specified constants, e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99); ['values']['table'] and ['values']['column'] restricts user input to the values found in the specified column of another table. If the optional ['values']['description'] is also specified, the values displayed to the user by PHPMyEdit will be taken from the column specified by 'description'. e.g.: ['values']['db']='mydb' *optional if table is in another database* ['values']['table']='mytable' ['values']['column']='key_column' ['values']['description']='result_column' *optional* ['values']['filters']='idcolumn in (1,,2,3)' *optional WHERE clause* ['values']['orderby']='result_column' *optional ORDER BY clause* if a column is either SET or ENUM type, then the values are put in by PME Setup. ['select'] = 'T/D/M' (text, drop-down, or multiple selection for filters) if a column is a SET type, then this is automatically 'M' Calculated Expressions example: $fdd['other']['name']='Col Header'; $fdd['other']['expression']='onHand-ordered'; $fdd['other']['sort']='T:!'; $fdd['other']['select']='T'; $fdd['other']['type']='int'; 'other' can be anything, but needs to be unique within the list of $fdd keys 'expression' can be any valid MySQL expression 'type' should reflect the results of the expression, e.g. 'int' or 'string' all other options work as with other, normal columns this kind of column is always read-only */ $fdd["Datum"] = Array( 'name'=>'Datum', 'select'=>'T', 'type'=>'date', 'maxlen'=>10, 'nowrap'=>false, 'required'=>true, 'default'=>'0000-00-00', 'sort'=>true ); $fdd["Heim"] = Array( 'name'=>'Heim', 'select'=>'T', 'type'=>'blob', 'maxlen'=>65535, 'nowrap'=>false, 'required'=>true, 'textarea'=>Array( 'rows'=>5, 'cols'=>50, 'wrap'=>'virtual' ), 'sort'=>true ); $fdd["Gast"] = Array( 'name'=>'Gast', 'select'=>'T', 'type'=>'blob', 'maxlen'=>65535, 'nowrap'=>false, 'required'=>true, 'textarea'=>Array( 'rows'=>5, 'cols'=>50, 'wrap'=>'virtual' ), 'sort'=>true ); $fdd["Erg1"] = Array( 'name'=>'Erg1', 'select'=>'T', 'type'=>'real', 'maxlen'=>11, 'nowrap'=>false, 'required'=>true, 'default'=>'0', 'sort'=>true ); $fdd["Erg2"] = Array( 'name'=>'Erg2', 'select'=>'T', 'type'=>'real', 'maxlen'=>11, 'nowrap'=>false, 'required'=>true, 'default'=>'0', 'sort'=>true ); $opts['fdd'] = $fdd; /* table-level filter capability if set, is included in the WHERE clause of any generated SELECT statement example: $opts['filters'] = "column1 like '%11%' AND column2<17"; ); */ /* Triggers are files that are included (via require) that perform actions (before or after) X (inserts, updates, or deletes). 'before' triggers are usually used to verify conditions prior to executing the main operation. 'after' triggers are usually used to perform follow-on operations after the main operation. For example, to update secondary tables to enforce referential integrity or to update aggregate tables. The operation sequence is this: before, main, after. If any operation fails, not only should the next operation(s) not be executed, but the previous ones are 'rolled back' as if they never happened. If a database is not able to do this, it is not 'transaction-safe'. Triggers are risky in basic MySQL as there is no native transaction support--it is not transaction-safe by default. There are transaction-safe table types in MySQL that can be conditionally built (see MySQL-Max), but PHPMyEdit is currently not set up to support real transactions. What that means is that if an operation fails, the database may be left in an intermediate and invalid state. The programmer must understand and accept these risks prior to using the PHPMyEdit triggers mechanism. If the triggers are used, they execute within the namespace or scope of the PHPMyEdit class. They _must_ return true or false to indicate success or failure. */ /* $opts['triggers']['insert']['before']=''; $opts['triggers']['insert']['after'] =''; $opts['triggers']['update']['before']=''; $opts['triggers']['update']['after'] =''; $opts['triggers']['delete']['before']=''; $opts['triggers']['delete']['after'] =''; */ /* logtable schema CREATE TABLE changelog ( updated timestamp(14) NOT NULL, user varchar(50) default NULL, host varchar(255) NOT NULL default '', operation varchar(50) default NULL, tab varchar(50) default NULL, rowkey varchar(255) default NULL, col varchar(255) default NULL, oldval blob, newval blob ); $opts['logtable']= 'changelog'; */ # get the user's default language and use it if possible $opts['language']= $HTTP_POST_VARS['HTTP-ACCEPT-LANGUAGE']; // and now the all-important call to PHPMyEdit // warning - beware of case-sensitive operating systems! require ''; $MyForm = new PHPMyEdit($opts); ?>