HOW DO I OUTPUT THE AUTHOR NAME?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpsmart
Forum Newbie
Posts: 6
Joined: Wed Jan 31, 2007 5:20 pm

HOW DO I OUTPUT THE AUTHOR NAME?

Post by phpsmart »


Recently I'm designing an internet forum using PHP.

I'm using two tables for my forum one is called (AUTHOR)with the fields (AUTHOR_ID, AUTHOR_NAME , AUTHOR_PASS) in which registered users are stored and another called (FORUM) with the fields (SUBJECT,BODY,NAME,DATETIME) in which the posts are stored.

After an author logs into the forum with his (id) and (password) he can either post a new topic or view topics.

My question: what is the code I need to output the name of the author who posted the topic?

To make it more clear in devnetwork forum you login with your username and password into the forum and when you post a new topic you need only to write the subject and message body(no need to write your name), after that in the forum's page you find that your topic is posted including the author name so how is that done?
Last edited by phpsmart on Tue Jul 24, 2007 5:20 am, edited 1 time in total.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Well when people log in, they get a session (or whateever phpBB uses.. I'm still not sure what their alternative is, but that's beyond the scope of this topic) that includes their author name (or username if it's different), right? Use that.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Thanks for not posting in color; now stop posting in bold please, phpsmart.
Post Reply