|
|||
|
Hello!
I'm starting to use the fetchAll method of the DBTable class and I'm wondering how to sort columns descending. I'm using a Sql Server database. The signature of fetchAll is: fetchAll($where, $order, $count, $offset); It seems that $order must be a column name. I tried $order='ORDER BY Name DESC' and it didn't work. $order='Name' worked. If that's the case, how do you order descending? Thanks! - Bret |
|
||||
|
Try the Zend_Db_Select object!
/** $db Zend_Db_Adapter */ $select = $db->select() ->from('table', array('column1', 'column2')) ->order(array('column1 DESC', 'column2 ASC')); $results = $db->fetchAll($select); Regards, AlesL
__________________
Internet Solutions - web development na sto in en način |
![]() |
| Thread Tools | |
| Display Modes | |
|
|