Hi,
Thanks so much for your help:)
When I tried your code:
<cfoutput>
#GetArticle.text#
</cfoutput>
it displays all the articles(there are 12 so far),and what I am trying to do is 
to just display each article text. I think that I might need to rethink the way 
that I set up the database, as I was not thinking that this would be so hard, 
or maybe it is just because it is my first time. I basically have 300 articles, 
and this seems like a good project to finally learn how to create a dynamic 
website. I also have the titles of the article, and this code does indeed just 
return the first entry.

The db is set up like:
id,title,text, date

Thanks so much for your help, I think that I will need to spend some time on 
this, it is really worth learning!
John


  
 


----- Original Message ----
From: J.J. Merrick <[EMAIL PROTECTED]>
To: CF-Newbie <[email protected]>
Sent: Saturday, November 24, 2007 6:26:54 PM
Subject: Re: cf query


John,

If you just want to display the first row you can do:

<cfoutput>
#GetArticle.text#
</cfoutput>


The 4th row would require a loop with a condition looking at
queryname.currentRow but if you are wanting to display the 4th row
then you need to ask yourself why you are bringing back that many
records in your query when you don't need them all.

J.J.


On 11/24/07, John  Barrett <[EMAIL PROTECTED]> wrote:
> Hi,
> I am trying to figure out how to display only one row?
> Thanks
> I have a database with information about health articles, such as
 title, article, date, etc. I am trying to display just the first roe, or
 just the 4th row of the article filed. I can't seem to get this.
> Hopefully somebody can help:)
> Here is my query:
> <!--- Query The Database for the articles --->
> <CFQUERY NAME="GetArticle" DATASOURCE="my_DSN">
>    SELECT          *
>    FROM             my_DSN
>    ORDER BY      article
> </CFQUERY>
>
> <CFOUTPUT QUERY="GetArticle">
> #text#
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3161
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to