Location: PHPKode > scripts > PHPMyApplication > phpmyapplication/Base_test/base_test.php
<?
// Note: this is a sample table (here table is 'test') creation and management file to help you get fammiliar with phpMyApplication


$tname="basetest"; 			//MySQL table name existing or to be created
$ttitle="Test table";


$z=0; //0 indicates first field.  Note: first col must be primary key
$pma[$z]['field']="id"; 	// field name (MySQL)
$pma[$z]['title']=" ID "; 	// title or caption { could be blank }
$pma[$z]['type']="xnum"; 	//*** type of this field { number: integer } ### MySQL type: INTEGER or VARCHAR
$pma[$z]['auto']=1; 	// Auto increment { No need to insert or modify when adding or editingexcept when you want to force it }
$pma[$z]['size']=10;	 // input box size
$pma[$z]['max']=6; 		// max length of input number
$pma[$z]['nolist']=1; 	// don't list this field
$pma[$z]['noedit']=1;	 // not editable
$pma[$z]['adminonly']=1; // Viewed by admin only


$z++; // ++ means next field! You can also use other variables or numbers. Move this paragraph to change place at generated form
$pma[$z]['field']="name"; //field name (MySQL) do not use space character. Better to use (a..z,0..9 and underline _ characters only)
$pma[$z]['title']=" Short Text sample field ";
$pma[$z]['type']="xchar"; //*** type of this field { varchar: short strings upto 255 } ### MySQL type: VARCHAR
$pma[$z]['max']=200; 	// max length of input string
$pma[$z]['size']=50;
$pma[$z]['required']=1;	 // mandatory field { should'nt be empty. user should enter data when adding or editing }


$z++; //next field
$pma[$z]['field']="txt";
$pma[$z]['title']=" Text field sample ";
$pma[$z]['type']="xtext"; //*** type of this field { textarea : text upto 64KB } ### MySQL type: TEXT
$pma[$z]['cols']="50";	 // number of columns of displayed textarea
$pma[$z]['rows']="10";	 // number of rows of displayed textarea
$pma[$z]['nolist']=1;


$z++; //next field
$pma[$z]['field']="chk";
$pma[$z]['title']=" Check box sample ";
$pma[$z]['type']="xcheck"; 		//*** type of this field  { checkbox } ### MySQL type: CHAR
$pma[$z]['ontitle']=" yes "; 	// display at list if checkbox is on instead of value
$pma[$z]['def']="1"; 			// default value, recommened to use 1 for normal usages


$z++; //next field
$pma[$z]['field']="radio";
$pma[$z]['title']=" Radio choice sample ";
$pma[$z]['type']="xradio"; 			//*** type of this field  { radio } ### MySQL type: CHAR
$pma[$z]['title1']=" Answer1 ";	 // first option title
$pma[$z]['val1']=1; 				//first option value
$pma[$z]['title2']=" Answer2 ";
$pma[$z]['val2']=2;
$pma[$z]['title3']=" Answer3 ";
$pma[$z]['val3']=3;
$pma[$z]['def']=2;			 // default value or checked one
// Note: you can add upto 10 options for xradio by defining as $fy[$z]['titlex']="" and $fy[$z]['valx']=  .Here we made 3 options


$z++;
$pma[$z]['field']="pic";
$pma[$z]['title']=" Image field sample ";
$pma[$z]['type']="ximage"; //*** type of this field { image jpg,gif,png } ### MySQL type: VARCHAR
$pma[$z]['max']=150; 		//K bytes maximum size of the image file
$pma[$z]['w']=1024; 		// maximum allowed width in pixels
$pma[$z]['h']=768; 			//maximum allowed height
$pma[$z]['folder']="test_images"; // folder name which images should be copied in (if dosn't exist create it before running)


$z++;
$pma[$z]['field']="sel";
$pma[$z]['title']=" Select field sample  ";
$pma[$z]['type']="xsel";	//*** type of this field or column { select } ### MySQL type: CHAR, TINYINT, SMALLINT, INTEGER OR VARCHAR
$pma[$z]['tbl']="city"; 	// name of the table which holds selection options (values and option)
$pma[$z]['kodf']="id"; 		// name of the field which holds code (value)
$pma[$z]['disf']="name";	// name of the field to be displayed (option)


$z++;
$pma[$z]['field']="num";
$pma[$z]['title']=" Number field sample ";
$pma[$z]['type']="xnum";// like field 0 { number }
$pma[$z]['max']=4; 
$pma[$z]['size']=4; 


$z++;
$pma[$z]['field']="file"; 				//field or column name
$pma[$z]['title']=" File field sample "; 	//title
$pma[$z]['type']="xfile";				//*** type of this field  { allowed file types such as .zip .doc .pdf ...} ### MySQL type: VARCHAR
$pma[$z]['max']=300; //K bytes max allowed file size
$pma[$z]['folder']="test_files";// folder name which files should be copied in (if dosn't exist create it before running)


$z++;
$pma[$z]['field']="time"; 		//field or column name { according to your table }
$pma[$z]['title']="Time field sample "; //title
$pma[$z]['type']="xtime";		//*** type of this field or column { timestamp } ### MySQL type: INTEGER
$pma[$z]['format']="d M, Y - G:i"; // time/date format {php time displaying format}
$pma[$z]['update']=1; 		//update when row is edited { acts as last update time , otherwise(0) as creation time}


//--------------------------------------------------------
require "phpmyapp.php";
?>
Return current item: PHPMyApplication