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-tp18233806p18233806.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to