'Basic' Message Board Reply

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
Junglejim
Forum Newbie
Posts: 1
Joined: Wed Apr 13, 2011 1:47 am

'Basic' Message Board Reply

Post by Junglejim »

I am in the process of creating a very simplistic message board system and im completely lost as to how to create a reply method for it(3 weeks running round in circles :banghead: ).

There is one sql database for it (using phpmyadmin) consisting of a table - 'threads'.

threads
id - primary key, auto incrementing
comment_title
comment
author
time

the time of the post goes into 'time' the author of the post goes into author, a user submitted message goes into comment and the messae title goes into 'comment_title'.

next the data is shown on a form(the message titles as a link to another form displaying the message).

Heres where im stuck, i cant figure out to make a reply to the message that is posted. I thought about using the primary key 'id' in the threads table somehow to link the reply message to a specific post but im completely unsure how to go about this (each post has a unique id number).

Im fairly new to sql and php.
Any help or suggestions would be greatly appreciated.
zyntrax
Forum Commoner
Posts: 32
Joined: Wed Apr 13, 2011 2:23 am
Location: Sweden

Re: 'Basic' Message Board Reply

Post by zyntrax »

http://www.phpbb.com/downloads/

This is what i would recommend, alot easier.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: 'Basic' Message Board Reply

Post by social_experiment »

Junglejim wrote:I thought about using the primary key 'id' in the threads table somehow to link the reply message to a specific post
You're on the right track, this 'primary key' (which will now become a foreign key) is used to tie the replies to the original message. You can put the 'id' value (hereafter messageID) as a hidden field, or maybe a session variable, depending on your script.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply