Ask a Question related to Dreamweaver AppDev, Design and Development.
-
JimCloud #1
Forum Reply Count SQL
I have an Access database table for a user forum I creating with ASP. I have
two ID fields for each message:
"msg_ID" as the primary key for each message
and "msg_parentID" to reference which message is being replied to.
The problem is this: I can't figure out the query to run so that I can include
a "# of Replies" column in the message list on the page. Will this be easier to
acheive by doing a query in Access and referencing that, or writing the whole
query code in the page itself (or perhaps within the repeated region of the
message list)?
Any help would be very much appreciated. Thanks.
JimCloud Guest
-
Forum error -- Reply title/subject being corrupted.
The last few days, when posting replies on this forum, the reply subject is not set correctly for me. It is usually a post or two behind. For... -
Forum error -- Reply title/subject being corrupted
The last few days, when posting replies on this forum, the reply subject is not set correctly for me. It is usually a post or two behind. For... -
reply
What kind of problems ? Please explain with error messages, etc. Would be nice also to give some details of your system (Operating System) Ray -
do not reply
Don't tell me what to do! "Dave Slater" <elninia@nospam.adelphia.net> wrote in message news:uIXXa.9708$jg.2578237@news1.news.adelphia.net... -
Hi - asp.net forum reply
dito "news.microsoft.com" <clopper.clopper@totalise.totalise.co.co.uk.uk> wrote in message news:eRMhT8oNDHA.2460@TK2MSFTNGP10.phx.gbl... it -
Michael Fesser #2
Re: Forum Reply Count SQL
.oO(JimCloud)
The easiest way to solve that is to add a third ID field to each message>I have an Access database table for a user forum I creating with ASP. I have
>two ID fields for each message:
>
> "msg_ID" as the primary key for each message
>
> and "msg_parentID" to reference which message is being replied to.
>
> The problem is this: I can't figure out the query to run so that I can include
>a "# of Replies" column in the message list on the page.
containing the thread ID, i.e. the ID of the first message in a thread.
Then all you have to do is to get the first message, grab its ID and
count how many other messages belong to that thread.
But if you want to show the number of replies for every single message
then it will become a bit more complicated ...
Micha
Michael Fesser Guest
-
JimCloud #3
Re: Forum Reply Count SQL
If I do add that third db field, what would the sql be to count the messages for each thread?
JimCloud Guest
-
Julian Roberts #4
Re: Forum Reply Count SQL
Maybe something like
select *,
(
select count(*) from messages b
where b.parentid=a.msgid
) as messagescount
from messages a
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-



Reply With Quote

