Forced to run DB Query from View (Bad practice?) |
[eluser]drewbee[/eluser]
Argh.. I wouldn't recomend a recursive function that makes database queries. Think about it. For every child you are making a new call to the database. Iwould hate to have to manage that. Take a look at this: http://www.sitepoint.com/article/hierarc...a-database It is the 'preorder tree transversal sitepoint', and you can get all the information you want in 1 query. (OR two queries if you need to identify the current category location); needless to say, this method is the best for performance. |
Welcome Guest, Not a member yet? Register Sign In |