Jump to content

help with a forum


ryans18

Recommended Posts

I've got a forum set up and works but the only problem is that when i display the last poster and/or who posted the topic, i have it reading the usernames in my database. but for every username in the database it repeats the post (long story short it echo's every username instead of just the one that posted it)

 

it was a simple forum where you typed in your name and topic and then it would post which worked fine. but then i started changing it so it just used the username instead of typing in a name. so my question is when a user fills in the text box and hits reply how do i store that information in the database so when i retrieve it, it shows who actually posted the message?

 

(my database has a login table and a forum table) if you need to see any part of the code let me know. thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/137972-help-with-a-forum/
Share on other sites

Well, you need to tie the 2 tables together. Either add a field in the forums table to store the user id that posted it, or create a new table and have it store the user id and post id. Either way you need to explicitly tie the poster to the topic and then retrieve that information together.

 

Nate

Link to comment
https://forums.phpfreaks.com/topic/137972-help-with-a-forum/#findComment-721204
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.