[thelist] php/sql - getting the rows right help (still my menuitem thing)

rudy r937 at interlog.com
Fri Nov 22 12:24:01 CST 2002


you haven't done anything to get the parents of the categories that the
menuitems are related to

you want

select stuff
   from menuitem
inner join category X
       on menuitem.categoryID = X.categoryID
left outer join category Y
       on X.parentID = Y.categoryID

the reason you want a left outer join is for those instances where the
menuitem's category doesn't have a parent category

sorting the output to get subcategories correctly "nested" under their
parent categories is your next challenge

how about i come over to your office and we can do this in person?


rudy




More information about the thelist mailing list