0

这是我的问题,我正在尝试在 symfony 中做标签云,我想要执行的是这样一个 sql 查询

select tag, count(tag) from tagi group by tag order by count(tag) desc limit 10

有人可以帮忙吗?

4

1 回答 1

1

在映射到“标记”表的 Peer(不是 BasePeer)类中创建一个函数。例子:

public static function doGetTags() {

    $connection = Propel::getConnection();
    // get the query from configuration
    $query = sfConfig::get('app_query_tags_all');
    $statement = $connection->prepare($query);
    $statement->execute();
    $results = self::populateObjects($statement);
}
于 2009-09-17T13:55:20.777 回答