Title: Post by email SQL error
Last modified: August 18, 2016

---

# Post by email SQL error

 *  Resolved [tomhanna](https://wordpress.org/support/users/tomhanna/)
 * (@tomhanna)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/post-by-email-sql-error/)
 * The post by email feature deletes the emails properly and shows the contents 
   of the email (when I run wp-mail.php), but that’s all it does. It doesn’t post
   anything. It returns these two errors:
 * 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‘
   AND category_id = 1’ at line 1]
    SELECT * FROM opp_post2cat WHERE post_id = AND
   category_id = 1
 * 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‘
   1)’ at line 4]
    INSERT INTO opp_post2cat (post_id, category_id) VALUES (, 1)
 * In wp-mail.php line 1 is – “require(dirname(__FILE__) . ‘/wp-config.php’);”
    
   and Line 4 is either a blank line or “$time_difference = get_settings(‘gmt_offset’)*
   3600;” which don’t really appear relevant. Obviously it’s a ‘line’ from some 
   other file or I’m missing something. I admittedly know just enough to be dangerous,
   but I can’t find where the file sets a value for “post_id” and it appears to 
   be trying to post a blank entry to the database for post_id.
 * Possibly relevant info:
    January 1 nightly build and January 16th build Operating
   system Linux Kernel version 2.4.21-27.0.1.ELsmp Apache version 1.3.33 (Unix) 
   PHP version 4.3.10 MySQL version 4.0.22-standard-log cPanel Build 9.9.9-CURRENT
   120 cPanel Pro 1.0 (RC2)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [blueorder](https://wordpress.org/support/users/blueorder/)
 * (@blueorder)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/post-by-email-sql-error/#post-132129)
 * I’m getting the same error. Looks like post_ID doesn’t have a value…
 *  [jaya](https://wordpress.org/support/users/jaya/)
 * (@jaya)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/post-by-email-sql-error/#post-132157)
 * can this help solve it?
    [http://wordpress.org/support/3/16610#post-95550](http://wordpress.org/support/3/16610#post-95550)
 *  Thread Starter [tomhanna](https://wordpress.org/support/users/tomhanna/)
 * (@tomhanna)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/post-by-email-sql-error/#post-132172)
 * Thanks, jaya.
 * It doesn’t look like the same problem (time zone is same for my server and my
   email) and it’s not getting them to the point where I can edit them.
 *  [blueorder](https://wordpress.org/support/users/blueorder/)
 * (@blueorder)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/post-by-email-sql-error/#post-132187)
 * posted it to mosquito…
 * [http://mosquito.wordpress.org/view.php?id=744](http://mosquito.wordpress.org/view.php?id=744)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Post by email SQL error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [blueorder](https://wordpress.org/support/users/blueorder/)
 * Last activity: [21 years, 4 months ago](https://wordpress.org/support/topic/post-by-email-sql-error/#post-132187)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
