Details

I have a problem displaying post and the comment in the same page. I use two MySQL tables caledd "comment" and "news". This is the "comment" table: CREATE TABLE IF NOT EXISTS `comment` ( `id_com` int(5) NOT NULL AUTO_INCREMENT, `id` int(5) NOT NULL, `comment` text NOT NULL, PRIMARY KEY (`id_com`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; And the "news" table is this: CREATE TABLE IF NOT EXISTS `news` ( `id` int(5) NOT NULL AUTO_INCREMENT, `title` varchar(500) NOT NULL, `news` text NOT NULL, `category` varchar(200) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; What I want to do is to display a record from the "news" and at the bottom of the content there is comment and comment form. I can insert the comment well where the "id" is stored same as of the each post. How I can show the post and at the bottom display the comment related to each post?

Use the RSS button to subscribe to comments for this request.

close this
Interested in seeing a response to this question? Vote for it!
Vote (0 votes)
Report abuse

Related recipes