$table = ‘tabulka’;

$col = ‘sloupec’;

$sql = “
    SHOW COLUMNS
    FROM
        {$table} LIKE ‘{$col}’       
    “;
$res = $this->getAdapter()->fetchRow($sql);
       
$enums = $res['Type'];
//upraveni retezce a vyparsovani polozek
$enums = str_replace(“enum(‘”, ”, $enums);
$enums = str_replace(“)”, ”, $enums);
$enums = str_replace(“‘”, ”, $enums);
$enums = explode(‘,’,$enums);
       
$result = array();
foreach ( $enums AS $enum )
{
    $result[$enum] = $enum;
}
       
return $result;

    /**
      * @return Objednavka
      */
     public static function getInstance()
     {          
          if ( null === self::$_instance )
          { 
               // Pripojeni k DB – pripojuje se na jinou db nez cely web, db proeshop_base, viz config
               $config = Zend_Registry::get(‘config’);
               $db_proeshop_base = Zend_Db::factory($config->db_proeshop_base->adapter, $config->db_proeshop_base->toArray());
 
               self::$_instance = new self($db_proeshop_base);
               self::$_instance->getAdapter()->query(“SET CHARACTER SET UTF8″);
          }     
          return self::$_instance;
     }

Join na tabulku, ze které potřebuju jen jeden řádek

SELECT
   e.jmeno,
   e.id,
   v.*
FROM
   ekostrazce AS e
JOIN vysledek_testu AS v
ON e.id = v.ekostrazce_id
   AND v.id = (
       SELECT
         id
      FROM
         vysledek_testu
      WHERE
        ekostrazce_id = e.id
      ORDER BY
        vysledek DESC,
       cas ASC
     LIMIT 1
)
LIMIT {$limit}