Hi I'm making a forum, and I have a problem with an sql statement.
I don't know if I can show it right but it's worth a shot. Here's a simplified version
MyPostTable:
PID
PostSubject
DatePosted
UserID
MyForumTable:
FID
ForumName
MyDicussionTable:
DID
ForumID (Linked To FID of my forum)
PostID(linked to the PID in MyPostTable)
LastPostID(Also Linked to the PID in MyPostTable)
MyUserTable:
UID
Username
Now here's what I'm looking for. I want to select my Discussions and Return
My problem is that I want 2 different usernames right, and I'm linking from myDiscussion table through MyPOst table to my usertable.
So how do I return 2 different username in one query and attach the datePosted to the User who last posted.
This is an issue I've run into many time but could never find a good SQL statement and end up always having to redidesign my table. SO I would be forever grateful to whomever would take time to help me.
Thanks a Million in advance.
Dan
I don't know if I can show it right but it's worth a shot. Here's a simplified version
MyPostTable:
PID
PostSubject
DatePosted
UserID
MyForumTable:
FID
ForumName
MyDicussionTable:
DID
ForumID (Linked To FID of my forum)
PostID(linked to the PID in MyPostTable)
LastPostID(Also Linked to the PID in MyPostTable)
MyUserTable:
UID
Username
Now here's what I'm looking for. I want to select my Discussions and Return
- PostSubject
- Username of The user who started the discussion
- Username of the user who last posted in the discussion
- DatePosted of the user who last posted in the discussion
My problem is that I want 2 different usernames right, and I'm linking from myDiscussion table through MyPOst table to my usertable.
So how do I return 2 different username in one query and attach the datePosted to the User who last posted.
This is an issue I've run into many time but could never find a good SQL statement and end up always having to redidesign my table. SO I would be forever grateful to whomever would take time to help me.
Thanks a Million in advance.
Dan