Re: [SMARTY] Array problem
| From: | Chris Prior | Date: | Sun, 24 Nov 2002 13:11:25 +0000 |
| Subject: | Re: [SMARTY] Array problem | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6535@lists.php.net to get a copy of this message | ||
In reply to "Re: [SMARTY] Array problem" from Michael Paluchowski
<paluchowski@post.pl>,
sent on 24 Nov 2002 at 13:25:
> >because i'm just working with the same thing as u. I have also some
> >categories with cat_id and parent_id in db that i'm pulling out every time i
> As for my designing guidelines, primarily I'm working to minimize the
> number of database queries needed to display a page. As you might have seen
Now that the discussion moves towards general database design methods
please allow me to throw in my own two eurocents - although bit OT:
Whenever working with categories and different levels of nesting I
strongly encourage everybody to look at PEAR:Tree which implements
nested sets easily.
If you have a basic understanding how PHP classes work you should be
able to speed up queries for "breadcrumb navigation", menu
hierarchies, picture book relations andandand...
Nested sets are a db design method where the relation of items is
defined by their left and right 'partners' instead of parents/child
IDs. Nested sets should be preferred if there are more reading than
writing accesses to the data in the DB.
Although written in german this page visualizes the basic concept
pretty well:
http://develnet.org/tech/tutorials/3.2.html
PEAR:Tree can be obtained here:
http://pear.php.net/package-info.php?pacid=104
It handles all related database queries lightning fast and I rewrote
plenty of code for the sake of using it. My http://www.radoo.de/
as a
YAHOO! derivate is just one example.
Smarty and PEAR:Tree are my best friends ;-)
writes pretty OT, I know,
Chris
--
Chris Prior, Berlin, Germany
public@prior-I.De
http://www.prior-I.De