示例#1
0
 /**
  * Returns all rows of given table
  * @param string $table
  * @throws SPException
  * @return array
  */
 public function getColumns($table)
 {
     static $cache = array();
     if (!isset($cache[$table])) {
         $this->setQuery("SHOW COLUMNS FROM {$table}");
         try {
             $cache[$table] = $this->loadResultArray();
         } catch (Exception $e) {
         }
         if ($this->db->getErrorNum()) {
             throw new SPException($this->db->stderr());
         }
     }
     return $cache[$table];
 }