select R_REPLY on forum.asp? - Posted (2211 Views)
Senior Member
MaD2ko0l
Posts: 1053
1053
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
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Average Member
cripto9t
Posts: 881
881
That's what I was afraid of :(. What db type are you using? If you could put these lines
Code:
Response.Write strSql & strSql6 & strSql3 & strSql7 & strSql4
Response.End
right before this line in forum.asp
Code:
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\-_
Posted
Senior Member
MaD2ko0l
Posts: 1053
1053
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
Posted
Average Member
cripto9t
Posts: 881
881
After a ton of searches, someone finally came up with a decient simple answer that I could understand smile.
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
Code:
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\-_
Posted
Average Member
cripto9t
Posts: 881
881
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 sad. Hopefully someone will spot what I've done wrong.<
    _-/Cripto9t\-_
Posted
Senior Member
MaD2ko0l
Posts: 1053
1053
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<
© 1999-2010 MaD2ko0l
Posted
Senior Member
MaD2ko0l
Posts: 1053
1053
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

MaD2ko0l<
© 1999-2010 MaD2ko0l
You Must enter a message