Depends on the forum software. For SMF you'd want to query the database tables messages and members and topics to get the topic subject, poster name, and the last message from whatever boards.
For phpBB you'd have to look into the table structure to find out where each post is stored, how it's stored, and how all the data links up.
With more information, we might help; however, if you're asking for support for a specific forum (SMF, phpBB, Phorum, vBulletin, Invision Power Board) we can't support any one board, and you'll have to post on their forums.