i guess it should be like this
PHP Code:
// Fetching a rowset
recents = $episode->fetchAll($episode->select()->where('bug_status = ?','NEW')
->order('bug_id ASC')
->limit(10, 0));
pass your variables in where, order, limit etc.
correct me if i am wrong