Login   Register  
PHP Classes
elePHPant
Icontem

File: Documentation_and_Demo/easyTables/php/getColumns.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of enri_pin  >  Easy Tables  >  Documentation_and_Demo/easyTables/php/getColumns.php  >  Download  
File: Documentation_and_Demo/easyTables/php/getColumns.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Easy Tables
Show, edit and export database table records
Author: By
Last change:
Date: 9 months ago
Size: 980 bytes
 

Contents

Class file image Download
<?php

    
/* 
        Parameters:
            configFile: Array with the values of the row that will be inserted
    */

    
include_once("DBHelper.class.php");
    
$dbhelper=new DBHelper($_REQUEST['configFile']);
    
$char=$dbhelper->character();
    
$esc=$dbhelper->escape();
    
$columns=$dbhelper->getColumns($dbhelper->query);
    
$string="<select name='searchField' class='searchField'>";
    
$colName="";
    if(isset(
$_REQUEST['searchFields'])){
        for(
$i=0;$i<count($_REQUEST['searchFields']);$i++){
            
$colName=((isset($dbhelper->colNames[$_REQUEST['searchFields'][$i]]))?$dbhelper->colNames[$_REQUEST['searchFields'][$i]]:$_REQUEST['searchFields'][$i]);
            
$string.="<option value='".$_REQUEST['searchFields'][$i]."'>".$colName."</option>";
        }
    }else{
        for(
$i=0;$i<count($columns);$i++){
            
$colName=((isset($dbhelper->colNames[$columns[$i]]))?$dbhelper->colNames[$columns[$i]]:$columns[$i]);
            
$string.="<option value='".$columns[$i]."'>".$colName."</option>";
        }
    }
    
$string.="</select>";        
    echo 
$string;
?>