Hi, I wonder if there are any pointers to the following problem.
I Have three tables.
tbllogin
L.userid
tblprofile
P.userid,p.prof ileid,name,surn ame,etc
tblWatches
WatchingUserID, watchedprofilei d
In each table these ids are the same
L.userid,P.user id,WatchingUser ID
In the query below I collect all the watchedprofilei d, being followed by WatchingUserID
watchedprofilei d = p.profileid
It all works fine. The problem I have is I want to include in the title and description of the page, details about the userid from tblprofile such as their name, surname etc.
Unfortunately as the query is written no combination and playing around with the query will get that info.
I just wondered if there was a different way to achieve the same result plus info from tblprofile about the userid that is used in the query.
Any pointers would be a great help
Thanks in advance
Richard
I Have three tables.
tbllogin
L.userid
tblprofile
P.userid,p.prof ileid,name,surn ame,etc
tblWatches
WatchingUserID, watchedprofilei d
In each table these ids are the same
L.userid,P.user id,WatchingUser ID
In the query below I collect all the watchedprofilei d, being followed by WatchingUserID
watchedprofilei d = p.profileid
Code:
lngprofileid=CLng(Request("UserID"))
If lngprofileid <> "" And lngprofileid <> 0 Then
Set rs=Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
SQLQuery="Select L.accept, etc,etc,etc FROM tbllogin L INNER JOIN tblprofile P ON L.UserId = P.UserId "
SQLQuery= SQLQuery & " where
SQLQuery= SQLQuery & " p.ProfileID in (Select WatchedProfileID from tblWatches where WatchingUserID = 0" & Clng(lngprofileid) & ")"
SQLQuery= SQLQuery & " order by L.latestvisit desc"
Unfortunately as the query is written no combination and playing around with the query will get that info.
I just wondered if there was a different way to achieve the same result plus info from tblprofile about the userid that is used in the query.
Any pointers would be a great help
Thanks in advance
Richard
Comment