OK, so I made some progress today, but I’m stuck on this:
I’m trying to list all the comments made by the logged in user. I have achieved that—I get the full output of comments when I don’t try joining another table.
But in listing the comments, I want to provide the name of the channel entry that was commented on, as well as a link to that channel entry. So I *think* I need to join the exp_comments table with the exp_weblog_titles table, but correct me if I’m wrong there. I have little SQL experience, so this has been fun…to say the least. Actually, I’m enjoying it, but it’s getting beyond my ability to blindly work through it. Here’s what I have:
{exp:query sql="SELECT entry_id, name, author_id, comment_date, comment FROM exp_comments AS c
JOIN exp_weblog_titles AS t
ON c.entry_id = t.entry_id
WHERE author_id = '<?php echo $logged_in_member_id; ?>'" limit="5" paginate="bottom"}
<h4>On {comment_date}, you commented on <a href="http://{url_title}">{title}</a>:</h4>
<p> <br />
{comment}<br />
<br />
</div></p>
<p>{/exp:query}Am I on the right track? Currently I’m getting the following error message:
Error Number: 1146
Table ‘cbis_expeng.exp_weblog_titles’ doesn’t exist
Also the limit/pagination seems to be ignored, so I need to figure that out too. Help?