Search This Blog

Saturday, August 7, 2010

Zend Db Table Abstract fetchRow add new objects to it

Programmer Question

Hello my friends.



I have a fetchRow, that is done like it:



$db = new Database();
$data = $db->fetchRow($db->select()->where('id = ?',$id));


Done it, I would like to retrieve all the files from the file table, like this:



$files = new Database();
$photos = $files->fetchAll($files->select()->where('id = ?',$data->id));


But it returns two different objects, how can I add it to only one object?



If I do:



$this->view->photos = $photos;
$this->view->data = $data;


It works, but how can I merge the photos inside the data?



Thanks and best regards.



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails