Couple of things. I am assuming ID is coming from the query results but you
have <a name="ID">. It should be <a name="#ID#"> if you want dynamic values
from the query resultset.

Not that I have not done this before but try to stay away from select *
unless you need all columns.

Hope this helps.

<Ajas Mohammed />
http://ajashadi.blogspot.com
We cannot become what we need to be, remaining what we are.
No matter what, find a way. Because thats what winners do.
You can't improve what you don't measure.
Quality is never an accident; it is always the result of high intention,
sincere effort, intelligent direction and skillful execution; it represents
the wise choice of many alternatives.


On Thu, Jul 28, 2011 at 1:23 AM, Michael Brown <singleconce...@gmail.com>wrote:

> Attempting to query a article database.  Displaying TOC and want to anchor
> to article on same page.  However when displaying the TOC, it shows the
> link, but shows the same ID on every topic line.  Any help from the pros out
> there would be great.
>
> Query code:
> <cfquery name=get datasource="#DSN#">
>         Select *
>   From DatabaseTable678
>         Where categories = '1' or categories = '2' or categories = '3' or
> categories = '4' or categories = '5'
>         order by categories
>         </cfquery>
>
>
> This is my code for the TOC:
>
> <h1>Table of Contents</h1>
> <cfoutput query="Get" group="categories">
>   <b>#Get.categories#</b>
>   <ul>
>   <cfoutput>
>    <a href="###get.ID#"><li>#Get.topic#</li></a>
>   </cfoutput>
>   </ul>
>   </cfoutput>
> <hr />
> Content linking:
>
> <cfloop query="get">
>    <div align="left" class="tbold"><cfoutput><strong>
>             <a name="ID">#topic#</a> </strong>| Question Number: #id# |
> Category: #categories#</cfoutput>  </div>
>    <hr align="center" width="100%" noshade>
>    <br>
>
>         <p class=tbold><strong>Question:</strong></p>
>    <p ><cfoutput>#ParagraphFormat(question)#</cfoutput></p>
>    <hr align="center" width="50%" noshade>
>         <p class=tbold><strong>Answer: </strong>
> <p><cfoutput>#ParagraphFormat(answer)#</cfoutput></p>
> <hr align="center" width="100%" noshade>
>
> </cfloop>
> --
> Michael Brown
> 770-605-5240
>
>  Marketing Solutions with vision!
> http://www.singleconcepts.com
>
>
>

Reply via email to