[plug] PHP / mySQL - recursive query problem

Ady Gould KiltOtter at bdu.org
Mon Mar 29 23:19:41 WST 2004


Anyone got good PHP / mySQL skills?
 
I've got a problem with a recursive table definition that I am having
hassles with and cannot get to comply (it seems it has anti-Assimilation
technology).
 
The basis is storage of locations around the globe, with the ability to get
more and more specific.
 
AU -> WA -> Perth -> Bayswater -> XX Street
AU -> WA -> Kalgoorlie -> YY Street
AU -> WA -> Kalgoorlie -> YZ Street
AU -> WA -> Kalgoorlie -> YX Street
AU -> NSW -> Sydney -> Surry Hills -> ZZ Street
AU -> NSW -> Sydney -> Surry Hills -> ZY Street
AU -> WA -> Perth -> Como -> XY Street
AU -> WA -> Perth -> XZ Street
AU -> WA -> Perth -> XA Street
 
as you can see the depth varies, and there will be specific detail at each
depth.
 
I have been battling using ADOdb / PHAkt (for Dreamweaver MX/MX 2004) with
infinite loops happening :(
 
Anyone give me a solution that shows the above list, preferably something
like:
 
AU 
  -> NSW 
    -> Sydney 
      -> Surry Hills 
        -> ZZ Street
          -> ZY Street
 -> WA 
   -> Kalgoorlie 
     -> YY Street
       -> YZ Street
         -> YX Street
   -> Perth 
     -> Bayswater 
       -> XX Street
     -> Como 
       -> XY Street
     -> XZ Street
     -> XA Street

The solution will have lots of possible uses including navigation,
breadcrumbs and more, so it could be useful for many people.

Thanks for the help


Ady

 

Ady "KiltOtter" Gould
Web Designer & Administrator, Educator, Otter and Kilt Wearer
Blogged @: Kilted  <http://www.livejournal.com/users/kiltotter> Kunundrums &
The  <http://www.bdu.org/%7Eotter/> Otter's Pool 
Useful sites:[Bears Down Under <http://bdu.org/> ] [TechniX.org
<http://technix.org/> ] [West Oz Leather <http://westozleather.com/> ]
[BDU.org <http://bdu.org/> ]

Cookie Monster: A lie is a terminological inexactitude. - Winston Churchill 
Cookies are generated automatically and do not necessarily reflect the
opinion of the sender.


 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20040329/e5e1c98d/attachment.html>


More information about the plug mailing list