Posts

Showing posts from February, 2012

Oracle limit with Zend Db

Sometimes we have problem when using Oracle database, because oracle don't have SELECT LIMIT statement. But from Zend Framework source below, SELECT LIMIT is simulated automatically when we are using Zend Db Select:



So we can use Zend Db Select to create query easily, like this:


$select = $db->select()
             ->from(array('p' => 'products'),
                    array('product_id', 'product_name'))
             ->limit(20, 10);


$result = $select->fetchAll();