<cfquery name="qcf_getSchools" datasource="yourDSN">
 SELECT s.SchoolID, s.SchoolName, t.SchoolType
 FROM Schools s, SchoolType t
 WHERE s.SchoolTypeID = t.SchoolTypeID
 ORDER BY t.SchoolType, s.SchoolName
</cfquery>

<cfoutput query="qcf_getSchools" group="SchoolType">
 #qcf_getSchools.SchoolType#
 <cfoutput>
  <a 
href="school.cfm?id=#qcf_getSchools.SchoolID#">#qcf_getSchools.SchoolName#</a>
 </cfoutput>
</cfoutput>

I would add a SchoolTypeID field to table SchoolType and then reference that 
ID within table Schools

hth,


Charles Hanlon
Senior Web Applications Developer
Food Service Enablers, Inc.
www.fsenablers.com

The People. The Platform. The Products.
Make the Difference


----- Original Message ----- 
From: "Steven Sprouse" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Wednesday, July 19, 2006 10:38 AM
Subject: Need help building pages with multiple queries and tables


> I'm new to this forum.  I'm hoping there's someone out there that can help 
> me with my problem.
>
> I'm trying to build a school directory similar to thi 
> (http://www.mcps.k12.md.us/schools/index.cfm) or this 
> (http://www.wcboe.k12.md.us/content/sch_schools.cfm)
>
> I have a Table named Schools with SchoolID, SchoolName, SchoolType, 
> SchoolAddr, etc. and I also have a table called SchoolType with a 
> fieldname of SchoolType that just lists Elementary, Middle, High, 
> Center/Program.
>
> I don't know if I set my database up incorrectly or not, but I can't 
> figure out a query (and the query string that I know I need) to get the 
> first page to output a list of schools by School Type, and then when you 
> click on the Go button or the School Name, it brings you to a page with 
> information Specific to that school.
>
> Can anyone out there PLEASE help me?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:247043
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to