useCode ()) $sql = "SELECT ". $entity->getCodeColumn () ." FROM ". $entity->getTable (); else $sql = "SELECT ". $entity->getPrimary () ." FROM ". $entity->getTable (); $sth = Database::singleton ()->prepare ($sql); $sth->execute (); header ('Content-Type: application/json; charset=UTF-8'); echo json_encode ($sth->fetchAll (PDO::FETCH_COLUMN));