Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

88 users online



more efficient use of mysql

more efficient use of mysql

Currently viewing this thread: 1 (0 members and 1 guests)


reregistered

reregistered

Neverside Newbie
Status: Offline!

more efficient use of mysql

I'm building a navigation set of links for a shop.
In my nav there are main catagories and sub catagories, the names of which are stored in a database.

First I do a search for the main catagories, then I loop through the results printing them. After printing each line, I do another search on the db for the sub catagories listed within that main catagory and loop through printing each one of them.

So in order to print all the links in the nav, I'm having to do 14 or 15 search on the db. While each search is quite efficient individually, altogether there is quite some delay every time you change/refresh the page.

Is there a more efficient way of doing this?

aonic

aonic

Neversidian
Status: Offline!

this might help: http://www.sitepoint.com/article/hierarchical-data-database

___________________

-Developer
-Forum Leader
-NeverNET

DigitalDream

DigitalDream

ruby on weapon
Status: Offline!

ahh i've been wondering about this too. thanks alot for the pointing aonic ^^

___________________

digitalDream // complete Webdesign solution //
- - - - - - [ end signature ] - - - - - -

reregistered

reregistered

Neverside Newbie
Status: Offline!

Thanks aoinc that is the sort of thing I want.
Unfortunately I building a CMS system for the links, so that article wouldn't be too easy to update.
I've managed it now in a different way, adding columns for firstnode order numbers and secondnode order numbers.

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0068 seconds.