EasyCFM.COM ColdFusion Forums / Coding Help! / Last Questions About my Forum

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Last Questions About my Forum

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

7R4C3
02-17-2004 @ 9:35 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

Hi everyone, thank u so much for helping my with my forum, its almost done.

I have a 2 final questions. I need to finish the page that displays all the discussions. 1. How do i count the number of replys? and 2. how do i make the threads
sorted by the latest reply date. As of now my threads are sorted by the initial date the topics were started.

Any ideas???
heres my site again:
http://4.33.102.98/7R4C3.db/userlogin.cfm

THANX
:)


7R4C3
02-18-2004 @ 4:19 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

help!!!!!!!!!help!!!!!!!!!!!help!!!!!!!! Playful

megan
02-18-2004 @ 5:06 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

well for latest reply date you would add to your sql statement something like: order by replydate desc

and when you do your query for the replys your would count the records with #queryname.recordcount#

~megan

Estne tibi forte magna feles fulva et planissima?

7R4C3
02-19-2004 @ 6:39 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

hey megan i not that familiar with record count.
can u please explain more. maybe some example of code too. Smile  i just need to see what exactly is goin on. i am not quite sure how cold fusion counts the # of rows in table and converts it into numerical form????
and te threads are sorted by date already just not by the latest reply date. oh well, heres te code to help u see. ok.


<cfquery name="qMessageQuery" datasource="DB">
SELECT
a.id, a.formid, a.thread, a.subject, a.date, b.USER, b.ID
from message a, Contacts b
where b.ID=a.formid
and a.id = a.thread
order by a.date DESC
</cfquery>

look see,
but it does not sort by the latest reply date.
only by wen te topic was created.



megan
02-19-2004 @ 6:53 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

Well, <cfoutput>#qMessageQuery.recordcount#</cfoutput>
should give you the number of records returned by your query - I don't know why your "order by" doesn't work, but I can tell you that if you are using access as your database, date is a reserved word and there will be problems if you name a column/field, "date"

is each "reply" an individual record? or did you add it to the body of the origial post?

~megan

Estne tibi forte magna feles fulva et planissima?

7R4C3
02-19-2004 @ 7:21 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

yes it is an individual record

megan
02-19-2004 @ 7:58 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

ok, then recordcount should give you the number or records your query retrieves ~megan

Estne tibi forte magna feles fulva et planissima?


Website Designed and Developed by Pablo Varando.