Support » How-To and Troubleshooting » Comments have gone loopy!

Comments have gone loopy!

  • Hi, my site (www.churchexperiment.com) has been up for quite a while with no real problems. Then I tried to set up an alternate background for comments as explained here: http://gfmorris.org/archives/2004/07/29/alternating-comment-classes/
    Everything went fine until we decided to ditch the backgrounds and removed it from the CSS. I was wary of taking out the wrong bits from wp-comments.php, so I just uploaded the original version from the initial installation. Now it’s gone bezerk!
    Now no comments appear – though they are listed in the recent comments on the right and the comments will say something like “2 comments” but then not actually show any. There is also this error message which I assume refers to wp-comments:
    Database error: [You have an error in your SQL syntax near ‘WHERE comment_post_ID = ’33’ AND comment_approved = ‘1’ ORDER BY comment_date’ at line 1]
    SELECT * FROM WHERE comment_post_ID = ’33’ AND comment_approved = ‘1’ ORDER BY comment_date
    See, for example: http://www.churchexperiment.com/archives/2004/07/11/scaling-down/#comments
    Nothing I try (including uploading different versions of wp-comments.php) seems to solve the problem. Any ideas?

Viewing 11 replies - 1 through 11 (of 11 total)
  • divrom,
    I’ll look into this and see what I can come up with.

    Did you backup your files before modifying them?

    Try replacing all the *comments files with files from a feshly downloaded WP package, and make sure you have the WP version numbers matched up, in case you were using 1.0.2 or something.

    No, Amit, where’s the challenge in that?! ;o) I didn’t backup anything ‘cos it didn’t enter my head that there would be a problem.
    2fargon, tried that – no change.

    Here’s some added info:
    When I go into admin and go to EDIT –> comments, I get this message..

    Database error: [You have an error in your SQL syntax near ‘ORDER BY comment_date DESC LIMIT 20’ at line 1]
    SELECT * FROM ORDER BY comment_date DESC LIMIT 20
    No comments found.

    The silly thing is that I know there are comments and they even show up in the recent comments list on the right.

    Any other ideas?
    We had done most of the testing and were on the verge of making this our main site. The only thing left, after customising it to work like a mini-CMS, was a bit of tweaking.
    So I’m extremely reluctant to re-install!

    It sounds like your settings might be messed up. Check the /wp-settings.php file for this line (18):

    $tablecomments = $table_prefix . 'comments';

    That’s what it should be set to from the default install.

    Thanks for that Schlosna. I’d got it sorted just before I saw your post.
    In the end I had to edit wp-comments.php and change line 20:
    $comments = $wpdb->get_results(“SELECT * FROM $wpdb->comments WHERE comment_post_ID = ‘$id’ AND comment_approved = ‘1’ ORDER BY comment_date”);
    $comments = $wpdb->get_results(“SELECT * FROM $tablecomments WHERE comment_post_ID = ‘$id’ AND comment_approved = ‘1’ ORDER BY comment_date”);
    Works fine now, ‘cept for the numbers all being the same (so I just changed it to a UL).

    That means you downloaded a mismatched file from a different version, and you may have other problems in the future. It sounds like you’re running 1.2, and the file you downloaded is not 1.2, it’s CVS.

    I guess I could be nice and offer up a copy of a non-hacked wp-comments.php from the WP 1.2 package to people who decide that they don’t need my functionality.

    Yeah, I’m worried about those problems, allusion.
    The line I added was taken from a WuhWuh version of wp-comments.php (is that the same as CVS?). I am running 1.2 as you said. But I tried everything else – bar reinstalling everything – and this is the only thing that worked.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Comments have gone loopy!’ is closed to new replies.