2008年8月22日星期五

Re: [fw-db] Idea for select options in Zend_Db_Select

I like the idea and would like to see better support for custom select queries like using SQL_CALC_FOUND_ROWS. There currently are no parameters to select(), and that seems like a very good use for them.

-Hector

Johan Isacsson wrote:
Hmm was it that bad of an idea?

Johan Isacsson skrev:
I have an idea for a lean way to add select options using Zend_Db_Select (like DISTINCT, SQL_CALC_FOUND_ROWS etc):
$db->select('SQL_CALC_FOUND_ROWS')->from('Table')->where(...)
or
$select = new Zend_Db_Select($db, 'SQL_CALC_FOUND_ROWS');

The idea is that everything that gets passed as the second parameter in the call to the select constructor would be added right after SELECT in the resulting query string.

I know i would like it, maybe someone else would to? :)

Regards,
Johan Isacsson


没有评论: