Jump to content

Advice on making a message forum


graham23s

Recommended Posts

Hi Guys,

 

i was going to make a very basic forum users post, view posts etc nothing no where near as technical as this forum , or anything like that

 

my question is, whats the best way to assosciate the logged in user with his post? would i be better grabbing his $id = $_GET['id']; <-- then storing the id in the forum table (to link that user with his posts)

 

CREATE TABLE `forum_posts` (
  `id` int(4) NOT NULL auto_increment,
  `topic` varchar(255) NOT NULL default '',
  `detail` longtext NOT NULL,
  `username` varchar(65) NOT NULL default '',
  `email` varchar(65) NOT NULL default '',
  `datetime` varchar(25) NOT NULL default '',
  `view` int(4) NOT NULL default '0',
  `reply` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE `forum_replies` (
  `post_id` int(4) NOT NULL default '0',
  `reply_id` int(4) NOT NULL default '0',
  `reply_username` varchar(65) NOT NULL default '',
  `reply_email` varchar(65) NOT NULL default '',
  `reply_answer` longtext NOT NULL,
  `reply_datetime` varchar(25) NOT NULL default '',
  KEY `reply_id` (`reply_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

thanks for any advice

 

Graham

Link to comment
Share on other sites

would i be better grabbing his $id = $_GET['id']; <-- then storing the id in the forum table (to link that user with his posts)

 

Yes. but as forum posters should be logged in (I assume you'll have a login system?), you can grab it from the $_SESSION array.

 

Also, no need to store the username, email type stuff in with each post, that is what the users table is for.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.