[thelist] More ASP/database questions...

rudy r937 at interlog.com
Wed Apr 18 12:17:47 CDT 2001


> I'm hoping that someone out there either has another
> solution for this type of problem, or could at least let me
> know that I'm on the right track with one of mine.

hi beau

solution 1 is okay for accessing the database but relies on extensive
processing by you in the web server

solution 2 is, as you say, dirty -- way too ineficient in the database
calls

the best way is to let the database do all the work

   select  category, subcat
     from tableA, tableB
    where tableB.categoryID = tableA.categoryID
   order by category, subcat

not sure how you handle the groups using ASP code, but in cold fusion it
would look like this --

   <cfoutput query="q" group="category">
     <p>Category: #category#
     <cfoutput>
     <br />Subcat: #subcat#
     </cfoutput>
     </p>
   </cfoutput>

the category prints only once and its subcats print under it


hope that helps


rudy.ca





More information about the thelist mailing list