Yeah, more information will probably be helpful. Basically, I am building a
very simple blog. When a person clicks on teh "fashion" tab on the home page,
they are taken to a page that shows the 5 most recent blog posts for that
category. If they want, the users can also view each post separately, kind of
like a permalink.
Currently, my query is as follows (be gentle with me :) ):
<cfquery name="Comments" datasource="#request.dsn#">
SELECT *
FROM PostComments
JOIN Users
ON PostComments.UserID=Users.UserID
<cfif isDefined("URL.postID")>
JOIN Posts
ON PostComments.PostID=Posts.PostID
WHERE Posts.PostID = '#URL.postID#' AND CategoryID = '#CategoryID#'
<cfelse>
JOIN Posts
ON PostComments.PostID=Posts.PostID
</cfif>
</cfquery>
Right now, this query works to grab a variety of information, such as the user
who posted the blog entry, the users who have commented, etc. Also, this works
fine when the individual blog entry is browsed; however, when the top 5 blog
entries are displayed, the information is simply looped from one post to
another, all of them showing the exact same "Comments" information. So
basically, I am trying to figure out how to get the results of "Comments" to
parse out correctly between the 5 blog posts that are being displayed on the
initial "fashion" page, displaying not only the correct number of comments for
each blog post, but also the correct comments with the correct blog post.
Also, I don't know if this has to do with anything, but I need the results of
this query to display within the results of my main "post" output query.
Thanks for everyone's responses so far. I really appreciate them!
Joel
>can you provide a little data for example?
>Thanks
>
>On 3/19/07, Joel Watson <[EMAIL PROTECTED]> wrote:
>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 &
Flex 2
Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2646
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15