Author |
Topic  |
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 06 August 2007 : 13:54:57
|
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< |
© 1999-2010 MaD2ko0l |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 06 August 2007 : 14:02:53
|
what is R_REPLY ?< |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 06 August 2007 : 14:38:52
|
DOH!
i mean R_AUTHOR from the REPLY table< |
© 1999-2010 MaD2ko0l |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 06 August 2007 : 15:11:12
|
ok, why do you want/need this in forum.asp ? forum.asp does not have any replies only topics.< |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 06 August 2007 : 15:46:38
|
|
© 1999-2010 MaD2ko0l |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 06 August 2007 : 16:16:31
|
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
Senior Member
   
United Kingdom
1053 Posts |
Posted - 06 August 2007 : 16:26:59
|
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< |
© 1999-2010 MaD2ko0l |
 |
|
cripto9t
Average Member
  
USA
881 Posts |
Posted - 10 August 2007 : 09:51:36
|
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.
< |
_-/Cripto9t\-_ |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 10 August 2007 : 13:50:59
|
yes please...it may help me out.
greatly apreciated< |
© 1999-2010 MaD2ko0l |
 |
|
cripto9t
Average Member
  
USA
881 Posts |
Posted - 11 August 2007 : 12:15:46
|
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 .< |
_-/Cripto9t\-_ |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 11 August 2007 : 13:47:00
|
yes i get a
Syntax error in JOIN operation
:-(< |
© 1999-2010 MaD2ko0l |
 |
|
cripto9t
Average Member
  
USA
881 Posts |
Posted - 11 August 2007 : 14:32:25
|
That's what I was afraid of :(. What db type are you using? If you could put these lines
Response.Write strSql & strSql6 & strSql3 & strSql7 & strSql4
Response.End right before this line in forum.asp
if strDBType = "mysql" then 'MySql specific code 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.< |
_-/Cripto9t\-_ |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 11 August 2007 : 17:09:00
|
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 < |
© 1999-2010 MaD2ko0l |
 |
|
cripto9t
Average Member
  
USA
881 Posts |
Posted - 12 August 2007 : 10:30:41
|
After a ton of searches, someone finally came up with a decient simple answer that I could understand . quote: 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
strSql6 = " FROM ((" & strMemberTablePrefix & "MEMBERS M, "
strSql6 = strSql6 & strActivePrefix & "TOPICS T), "
strSql6 = strSql6 & strMemberTablePrefix & "MEMBERS AS MEMBERS_1) "
strSql6 = strSql6 & "LEFT JOIN " & strActivePrefix & "REPLY R "
strSql6 = strSql6 & "ON T.TOPIC_ID = R.TOPIC_ID AND R.R_AUTHOR = " & MemberID I hope this works. It will end an access mystery for me.< |
_-/Cripto9t\-_ |
 |
|
cripto9t
Average Member
  
USA
881 Posts |
Posted - 12 August 2007 : 17:12:50
|
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.< |
_-/Cripto9t\-_ |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 13 August 2007 : 15:41:40
|
i tryed this
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< |
© 1999-2010 MaD2ko0l |
 |
|
Topic  |
|