Thanks Matthew,

So my direction is fine, that's good! So it is architectually ok to have
database queries inside a helper.

What I was also after, was how to put the query in the helper. If you have
any pointers on that, it would be great. In the mean time I will try some
solutions myself.



etopian wrote:
> 
> Hi,
> 
> I'm trying to move some functions from older applications to my Zend
> Framework application. I assume I put these each in a seperate view
> helper? 
> Besides that, I have this function:
> 
> function findNumParents($id, $parents){
>   $sql = "SELECT 
>                id, 
>                parent_id 
>              FROM 
>                cms_pages 
>              WHERE id=".$id;
>   $fnp = fmsq($sql, true);
>   $parents++;
>   if($id == $fnp['id']){
>     if($fnp['parent_id']){
>       return findNumParents($fnp['parent_id'], $parents);
>     }
>   }
>   return $parents;
> }
> 
> My question is, how can I make the query to the database inside a View
> Helper? Or is that the wrong way to approach this?
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Recursive-database-query-in-View-Helper-tp18233806p18236693.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to