pancy1 (2) [Avatar] Offline
#1
I have set up correctly the parameters for Zend_Db::factory and then I am querying like:

$select = $db->select()
->from('imdb')
->limit(10);

$stmt = $db->query($select);
$result = $stmt->fetchAll();

Question: Why I do not see anything displayed?

I continue and I am trying to display results by creating a new object

$moviesTBL = new Application_Model_DbTable_Imdb();
$this->view->albums = $moviesTBL->fetchAll();

If I combine it with a view it works fine BUT fetches all rows!!! How to make it fetch only first 10?

foreach($this->albums as $key=> $value)
{
echo $value ->rank.' '.$value->rating.' '.$value->title.' '.$value->year.' '.$value->number_of_votes.'
';
}