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
https://forums.phpfreaks.com/topic/49492-advice-on-making-a-message-forum/
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.

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.