Example #1
0
 /**
  * Get field list of table
  * @param string
  * @return mixed
  */
 function fieldsList($sTableName)
 {
     $sTableName = CDatabase::str2sql($sTableName);
     switch ($this->getDriverName()) {
         case 'pgsql':
             return $this->select_one_column('SELECT column_name FROM information_schema.columns WHERE table_name =' . $sTableName);
             break;
         case 'mysqli':
         case 'mysql':
             $aResult = array();
             $aFields = $this->select('DESCRIBE ' . $sTableName);
             foreach ($aFields as $v) {
                 $aResult[] = $v['Field'];
             }
             return $aResult;
             break;
     }
 }