First off, when the user posts store the user that posted in the post entry. Then when you are getting the post entry, you just find out whats inside the posted user entry and do for example:
"SELECT * FROM `users` WHERE `Username` = '$sqlResult[USERNAME]'"
Thats how i'm doing it for the forums i'm making, but... theres probably a better way.