This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

access to comment text?
#1

Good results so far, now I'd like to display a single line or so as a collection of comment summaries ... can anyone provide the sql table/field name info? Along the lines of :

$page_query = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "pages` WHERE `id` = '" . $comment["page_id"] . "'");

but including the actual comment text in the result?

Thanks in advance
Reply
#2

Hi,

You may want to take a look at the Recent Comments add-on.

On line 16, you could use $comment["comment"] to display the comment text.

Hope that helps.

Have you completed the interview?
Reply
#3

This is the structure of the comments database table:

PHP Code:
<?php 
mysql_query
("CREATE TABLE IF NOT EXISTS `" . $cmtx_mysql_table_prefix . "comments` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(250) NOT NULL default '',
`email` varchar(250) NOT NULL default '',
`website` varchar(250) NOT NULL default '',
`town` varchar(250) NOT NULL default '',
`country` varchar(250) NOT NULL default '',
`rating` tinyint(1) unsigned NOT NULL default '0',
`reply_to` int(10) unsigned NOT NULL default '0',
`comment` text NOT NULL,
`reply` text NOT NULL,
`ip_address` varchar(250) NOT NULL default '',
`page_id` int(10) NOT NULL default '0',
`is_approved` tinyint(1) unsigned NOT NULL default '1',
`approval_reasoning` text NOT NULL,
`is_admin` tinyint(1) unsigned NOT NULL default '0',
`is_sent` tinyint(1) unsigned NOT NULL default '0',
`sent_to` int(10) unsigned NOT NULL default '0',
`vote_up` int(10) unsigned NOT NULL default '0',
`vote_down` int(10) unsigned NOT NULL default '0',
`is_flagged` tinyint(1) unsigned NOT NULL default '0',
`is_sticky` tinyint(1) unsigned NOT NULL default '0',
`is_locked` tinyint(1) unsigned NOT NULL default '0',
`dated` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"
);

Have you completed the interview?
Reply
#4

Steven, thanks!
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by mtnlvy
06-Jan-2019, 06:29 PM
Last Post by allseo
19-May-2018, 08:03 AM
Last Post by Steven
12-Feb-2018, 10:11 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)