Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/65312?pagenum=1
05 November 2025, 04:56
Topic
MaD2ko0l
select R_REPLY on forum.asp?
06 August 2007, 13:54
hiya, as the title says, i want to select R_REPLY from the Reply table. and i dont know how to incorporate it into the current select statement where it is selecting the topics.
can anyone help me?
thansk
MaD2ko0l<
Replies ...
HuwR
06 August 2007, 14:02
what is R_REPLY ?<
MaD2ko0l
06 August 2007, 14:38
DOH!
i mean R_AUTHOR from the REPLY table<
HuwR
06 August 2007, 15:11
ok, why do you want/need this in forum.asp ? forum.asp does not have any replies only topics.<
MaD2ko0l
06 August 2007, 15:46
HuwR
06 August 2007, 16:16
I'm not sure I agree with your thinking, for a start forum.asp already tells you if you are the author, your name is listed as the author, but hey, if you want to slow your forum down who am I to stop you.
I would write a function to which you pass the member_id and the forum_id and the topic_id and return true/false if you post in it, in the function you need a simple query like below (not tested obviously)
SELECT REPLY_ID FROM FORUM_REPLY WHERE FORUM_ID=ForumId AND TOPIC_ID=TopicId AND R_AUTHOR=MemberId
ForumId,TopicId and MemberId are the values you passed to the function, if the query returns any results then you made a post in that topic.<
MaD2ko0l
06 August 2007, 16:26
hiya, i know forum.asp tells u if u r the author, but what i am trying to do is to get forum.asp to tell me if i have posted a reply in a topic.
will try the code in a bit<
cripto9t
10 August 2007, 09:51
I got this to work by counting the replies in the topic sql.
I can only test with a mySql db and from experiece with some of my other mods I doubt it will work with access.
If you want I'll get the files together for you.
<
MaD2ko0l
10 August 2007, 13:50
yes please...it may help me out.
greatly apreciated<
cripto9t
11 August 2007, 12:15
I think I got everything.
Right click and Save.
If you are using any db other than MySql5 you may recieve an error, but maybe one of the local db gurus can help .<
MaD2ko0l
11 August 2007, 13:47
yes i get a
Syntax error in JOIN operation
:-(<
cripto9t
11 August 2007, 14:32
That's what I was afraid of :(. What db type are you using?
If you could put these lines
And post the results. Maybe someone with your db type experience could help.
When I upgraded my MySql db I had the same issue. Rearranging the parenthesis fixed it. I think that's the problem here.<
MaD2ko0l
11 August 2007, 17:09
hiya,
im using an access db and this is the output i get
SELECT T.T_STATUS, T.CAT_ID, T.FORUM_ID, T.TOPIC_ID, T.T_VIEW_COUNT, T.T_SUBJECT, T.T_MESSAGE, T.T_AUTHOR, T.T_STICKY, T.T_REPLIES, T.T_UREPLIES, T.T_LAST_POST, T.T_LAST_POST_AUTHOR, T.T_LAST_POST_REPLY_ID, M.M_NAME, MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME FROM ((FORUM_MEMBERS M, FORUM_TOPICS T, FORUM_MEMBERS AS MEMBERS_1) LEFT JOIN FORUM_REPLY R ON (T.TOPIC_ID = R.TOPIC_ID AND R.R_AUTHOR = 1)) WHERE M.MEMBER_ID = T.T_AUTHOR AND T.T_LAST_POST_AUTHOR = MEMBERS_1.MEMBER_ID AND T.FORUM_ID = 1 AND T.T_LAST_POST > '20070712220933' GROUP BY T.TOPIC_ID HAVING COUNT(R.R_AUTHOR) > -1 ORDER BY T.T_LAST_POST DESC Microsoft JET Database Engine error '80040e14'
Syntax error in JOIN operation.
/na/snitzprivate/forum.asp, line 354 <
cripto9t
12 August 2007, 10:30
After a ton of searches, someone finally came up with a decient simple answer that I could understand .
The JetSQL syntax is: FROM ((table1 INNER JOIN table2 ON ....) INNER JOIN table3 ON ....) INNER JOIN table4 ON ...
Going with that syntax try replacing strSql6 with this
I hope this works. It will end an access mystery for me.<
cripto9t
12 August 2007, 17:12
Nope that doesn't work either. I was able to log on to my free site with an access db and try a few things before I got kicked off. No luck . Hopefully someone will spot what I've done wrong.<
MaD2ko0l
13 August 2007, 15:41
i tryed this
Code:
strSql6 = " FROM FORUM_MEMBERS M, (FORUM_TOPICS T INNER JOIN FORUM_REPLY R ON( T.TOPIC_ID = R.TOPIC_ID AND R.R_AUTHOR =" & MemberID & ")) , FORUM_MEMBERS AS MEMBERS_1"
it was straight out of access and now i get this error
You tried to execute a query that does not include the specified expression 'T_STATUS' as part of an aggregate function<
MaD2ko0l
05 June 2008, 14:46
hi, i think i did it. i did what Huwr said to do.
so can someone check over it and make sure everyhting looks ok for me?
here the link Click Me thanks