예제 #1
0
 function __construct()
 {
     if (isset($_REQUEST["table_name"])) {
         vtorc($_REQUEST["table_name"]);
         //validate input
     }
 }
예제 #2
0
 function SubLookupTable($_tbl_name = "")
 {
     vtorc($_tbl_name);
     //verify it's valid table name (commonfunc.php)
     if (!empty($_tbl_name)) {
         $this->tbl_name = $_tbl_name;
         $sql = "SHOW COLUMNS FROM " . $this->tbl_name;
         $result = mysql_query($sql);
         $cnt = 0;
         //first column is primary key and second is lookup value
         while ($row = mysql_fetch_array($result)) {
             if ($cnt == 0) {
                 $this->prim_key_col = $row['Field'];
             } else {
                 if ($cnt == 1) {
                     $this->lookup_value_col = $row['Field'];
                 } else {
                     if ($cnt == 2) {
                         $this->lookup_tbl_id_col = $row['Field'];
                     }
                 }
             }
             $cnt++;
         }
     }
 }
예제 #3
0
 function set_table_name($_tbl_name)
 {
     vtorc($_tbl_name);
     //verify it's valid table name (commonfunc.php)
     if (!empty($_tbl_name)) {
         $this->tbl_name = $_tbl_name;
     } else {
         die("table cannot be empty: msg:2lk3mn;alksd78");
     }
 }