0

I have successfully fetched a rowset from my database table unto the view script. I did a var_dump($result) on the view script to confirm. But I am unable to fetch the individual rows to properly display their contents.

<?php
if($this->result)
    while($data =$this->result->getRow())
        var_dump($data);

I get the error message(truncated..):

Message: No row could be found at position 0 
Stack trace:
#0 C:\wamp\www\events\application\views\scripts\event\fetch.phtml(6): Zend_Db_Table_Rowset_Abstract->getRow()
....
....

what am I doing wrong?

okey_on
  • 2,888
  • 8
  • 28
  • 36

1 Answers1

-1

I finally got it sorted. The getRow() method apparently does not work with while() loops. I switched to foreach() loop and it's resolved.

Though I would still like to know why the while() loop does not work.

okey_on
  • 2,888
  • 8
  • 28
  • 36