PHP Classes

File: easyTables/php/getColumns.php

Recommend this page to a friend!
  Classes of enri_pin   Easy Tables   easyTables/php/getColumns.php   Download  
File: easyTables/php/getColumns.php
Role: Example script
Content type: text/plain
Description: Class source
Class: Easy Tables
Show, edit and export database table records
Author: By
Last change:
Date: 10 years 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;
?>