Let me make sure that I understand you:
You have many books and book ids. You have separate text records for each.
You wish to display ONE book id and ONE title, but all text. Assuming that
your text records are in some sort of order (paragraph, section, whatever),
you could use group by and try this out:
Your query:
<CFQUERY NAME="getText" DATASOURCE="#request.site.mainDSN#">
SELECT books.bookID, books.bookNumber, books.bookName,
content.textOrder, content.bookID, content.text
FROM books, content
WHERE (content.bookID = books.bookID)
ORDER BY books.bookNumber, content.textOrder
</CFQUERY>
Assumptions: You have 2 tables, books and content. Each has a Primary Key
(bookID, textID). bookID serves as the foreign key for the content table.
You have some way of ordering the text (content.textOrder). This query will
order your recordset in the way that you wish. To display it, do this:
<cfoutput query="getText" group="bookNumber">
<tr>
<td>Book #getText.bookNumber# -
#getText.bookName#</td>
</tr>
<cfoutput>
<tr>
<td>#getText.text#</td>
</tr>
</cfoutput>
</cfoutput>
What this will do is display one instance of the book number and name (the
group attribute of the first cfoutput tag), then loop through the recordset
displaying all text, ordered by textOrder.
This may at least get you going in the right direction. Feel free to respond
with any questions...
Marwan Saidi
Webmaster
CED - Concord IS
[EMAIL PROTECTED]
407.741.8645
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists