Simple Display Results from Database

For programming and general questions on Zend Framework
Post Reply
Posts: 2
Joined: Mon Nov 04, 2013 6:45 pm

Simple Display Results from Database

Post by pana4219 » Wed Nov 06, 2013 1:14 am

I have set up correctly the parameters for Zend_Db::factory and then I am querying like:

$select = $db->select()

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

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.'<br>';

Post Reply