xvszero
06-12-2009, 01:17 PM
This seems like it should be such an easy thing to do, but I'm a bit stumped. Basically I have a forum and on the main forum page I have a link to the thread, the user who posted it, date/time posted, etc. Typical forum stuff. In the database the post stuff is stored in parentmessages and is joined to the userinfo table on userid to get the poster's username, user font colors, user type, etc.
(I stripped it down here to the basics just to show how it is joined...)
SELECT parentmessages.*, userinfo.username AS username FROM parentmessages, userinfo WHERE parentmessages.userid = userinfo.userid
Now, I also have a field in the parentmessages table called lastreplyuser that saves the userid of the person who has replied to the thread last. I want to join to the userinfo table to get their username, font colors, etc. and post it on the main forum page for each thread, but I'm already joined to the userinfo table to get the user who posted the thread's info.
I'm not even sure if this is possible. Maybe with a temp table that is essentially the userinfo table? I dunno.
Help?
(I stripped it down here to the basics just to show how it is joined...)
SELECT parentmessages.*, userinfo.username AS username FROM parentmessages, userinfo WHERE parentmessages.userid = userinfo.userid
Now, I also have a field in the parentmessages table called lastreplyuser that saves the userid of the person who has replied to the thread last. I want to join to the userinfo table to get their username, font colors, etc. and post it on the main forum page for each thread, but I'm already joined to the userinfo table to get the user who posted the thread's info.
I'm not even sure if this is possible. Maybe with a temp table that is essentially the userinfo table? I dunno.
Help?