I corrected the typo but it still doesn't work :(
My full code is:
<?php
global $wpdb;
$sql =
"SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID,
comment_author, comment_date, comment_approved, comment_type,comment_author_url,
SUBSTRING(comment_content,1,100) AS com_excerpt
FROM $wpdb->comments
LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID)
INNER JOIN $wpdb->term_relationships as r1 ON ($wpdb->posts.ID = r1.object_id)
INNER JOIN $wpdb->term_taxonomy as t1 ON (r1.term_taxonomy_id = t1.term_taxonomy_id)
WHERE comment_approved = '1'
AND comment_type = ''
AND post_password = ''
AND t1.taxonomy = 'category'
AND t1.term_id IN ('10','20')
ORDER BY comment_date DESC LIMIT 4";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
$output .= "\n";
foreach ($comments as $comment) {
$output .= "« ID)."#comments" . "\" title=\"Comment on ".$comment->post_title . "\">" . strip_tags($comment->com_excerpt)."... » Comment on ". strip_tags($comment->comment_author) ." , ". strip_tags($comment->comment_date) ."";
}
$output .= "\n";
$output .= $post_HTML;
echo $output;
?>
I don't know why it doesn't work...