Hey, mates. I'm having issues with getting comments from one table to display alongside the article they're associated with. Here's the deal. I have an article with a permalink -- a link to the archive page which passes the article id as a parameter -- once the link is clicked, you're taken to the individual article with it's corresponding comments (there is also a form to submit them).
Therein lies the problem. I can't get the comments themselves to recognize what article they belong to. I'll submit a comment in an article, but the comment will be viewable in all of the articles. I definitely don't want this.
Here are my two table structures:
TABLE `mngmnt_comments_cmnt` (
`id_cmnt` int(11) NOT NULL auto_increment,
`idart_cmnt` int(11) NOT NULL default '0',
`name_cmnt` varchar(255) NOT NULL default '',
`email_cmnt` varchar(255) default NULL,
`uri_cmnt` varchar(255) default NULL,
`text_cmnt` longtext NOT NULL,
PRIMARY KEY (`id_cmnt`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
The idart_cmnt field is the field I want to use to insert the corresponding article id into (via the comment form)
TABLE `mngmnt_article_art` (
`id_art` int(11) NOT NULL auto_increment,
`idtop_art` int(11) NOT NULL default '0',
`idcmnt_art` int(11) NOT NULL default '0',
`title_art` varchar(100) NOT NULL default '',
`music_art` varchar(200) NOT NULL default '',
`description_art` varchar(255) NOT NULL default '',
`text_art` longtext NOT NULL,
`date_art` text,
PRIMARY KEY (`id_art`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
Any help would be appreciated on how to solve my issue. Thanks. 😉