|
|||
|
I have a Zend_Db_Table class and im trying to run this query:
SELECT * FROM (SELECT * FROM `stories` WHERE submit_date > 1211351819 AND timestamp < 1211438219 ORDER BY diggs DESC) a GROUP BY story_id ORDERY BY diggs DSEC how would I do it using the select method? I.E. $this->fetchAll($this->select()->....) Thanks! |
|
|||
|
I'm no expert on SQL. But that SQL statement seems to be wrong. Have you tried running that SQL line in your database and see if you get a result? It looks wrong to me in syntax at first sight :s.
though your sql would be something like this. (Code is ran inside the model of a certain table) Code:
$sql = $this->select()->from()->where()->order()->limitpage(); return $this->fetchAll($sql); e.g. $sql = $this->select()->where('ID > ?', 3); will return something like SELECT * FROM <tablemodel you're in> WHERE (ID = 3) Last edited by Filip : 05-23-2008 at 11:54 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|