Title: Database error when a comment is posted.
Last modified: August 18, 2016

---

# Database error when a comment is posted.

 *  [abohart](https://wordpress.org/support/users/abohart/)
 * (@abohart)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/)
 * I get the following errors when someone posts a comment:
 * WordPress database error: [You have an error in your SQL syntax; check the manual
   that corresponds to your MySQL server version for the right syntax to use near‘
   WHERE comment_ID = 36’ at line 1]
 * UPDATE wp_comments SET comment_reply_ID= WHERE comment_ID = 36;
 * Warning: Cannot modify header information – headers already sent by (output started
   at /nfsn/content/philatelictidbits/htdocs/wp-includes/wp-db.php:98) in /nfsn/
   content/philatelictidbits/htdocs/wp-comments-post.php on line 44
 * [Repeat errors]
 * Any idea on how to fix this?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/page/2/?output_format=md)

 *  [ColdForged](https://wordpress.org/support/users/coldforged/)
 * (@coldforged)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-194747)
 * Sounds like you have some sort of threaded comments plugin enabled but without
   the appropriate change to the tables.
 *  Thread Starter [abohart](https://wordpress.org/support/users/abohart/)
 * (@abohart)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-194750)
 * Well, I do have a threaded comments plugin enabled, but I don’t recall there 
   being any need for a change to the tables. I will check on that.
 *  Thread Starter [abohart](https://wordpress.org/support/users/abohart/)
 * (@abohart)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-194755)
 * Okay, it is definitely connected with the threaded comments plugin, as the problem
   disappears when I disable it. I am using Brian’s threaded comments. How do I 
   get it to work again? It used to work before I switched to the Equix theme.
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195266)
 * But, I get this problem even without this threaded plugins.
 * Is it because of Spam Karma?
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195267)
 * I have never seen this error with SK/SK2.
    Have you altered any core files ? 
   Tried running upgrade.php ?
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195268)
 * No i haven’t editted any core files.
 * Should I run upgrade.php again? I am using 1.5.1
 * [http://www.ajaydsouza.com](http://www.ajaydsouza.com)
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195269)
 * I ran upgrade.php again.
 * Can you post a comment on my blog and see what you get?
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195270)
 * Posted, no error 🙂
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195272)
 * Checked….. hopefully it doesn’t return……
 * Scratches head.
 * Thanks for testing 🙂
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195273)
 * Damn it returned when I posted.
 * > WordPress database error: [You have an error in your SQL syntax. Check the 
   > manual that corresponds to your MySQL server version for the right syntax to
   > use near ‘t return.’ LIMIT 1′ at line 1]
   >  SELECT comment_ID FROM wp_comments
   > WHERE comment_post_ID = ‘298’ AND ( comment_author = ‘Ajay’ OR comment_author_email
   > = ‘me@ajaydsouza.com’ ) AND comment_content = ‘So far so good. Hopefully, it
   > doesn’t return.’ LIMIT 1
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 51
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 52
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 53
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 55
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 56
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 57
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 58
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-includes/pluggable-functions.php on line 129
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195274)
 * [http://codex.wordpress.org/Answers-Trouble_Shooting#Headers_already_sent](http://codex.wordpress.org/Answers-Trouble_Shooting#Headers_already_sent)
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195282)
 * Already tried that moshu several times.
    The files don’t have any spaces
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195283)
 * Now it doesn’t seem to be coming.
    Is this some random occurence?
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195284)
 * If you have a spam blacklist, check it for spaces / wierd characters.
    Does your
   email address have any wierd characters ? Does this happen if you post with one
   address and not another ? Are you running the latest version of SK for your install?
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [21 years ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/#post-195289)
 * > WordPress database error: [You have an error in your SQL syntax. Check the 
   > manual that corresponds to your MySQL server version for the right syntax to
   > use near ‘s fixed now hopefully. Thanks for the ErrorDocument SELECT comment_ID
   > FROM wp_comments WHERE comment_post_ID = ‘302’ AND ( comment_author = ‘Ajay’
   > OR comment_author_email = ‘me@ajaydsouza.com’ ) AND comment_content = ‘I have
   > gotten the site working again. For some reason the .htaccess file disappeared.
   > It’s fixed now hopefully. Thanks for the ErrorDocument code. I have added that
   > to the .htaccess Now I guess you can link to the plugin. I have also released
   > the plugin via WP-Plugin manager. Lastly, who did you find the id of my post?’
   > LIMIT 1
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 51
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 52
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 53
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 55
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 56
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 57
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-comments-post.php on line 58
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/ajay82/public_html/wp-includes/wp-db.php:98) in /home/ajay82/
   > public_html/wp-includes/pluggable-functions.php on line 129
 * Running the latest version of SK2 and wP.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/page/2/?output_format=md)

The topic ‘Database error when a comment is posted.’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 5 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/database-error-when-a-comment-is-posted/page/2/#post-195301)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
