Title: error in sql syntax
Last modified: August 18, 2016

---

# error in sql syntax

 *  [moggy](https://wordpress.org/support/users/moggy/)
 * (@moggy)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/error-in-sql-syntax/)
 * 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 ‘limit,
   1’ at line 1]
    SELECT ID,post_title FROM wp_posts WHERE post_date > ‘2005-01-
   03 14:59:20’ AND post_date < ‘2005-01-04 13:48:45’ AND post_status = ‘publish’
   AND ID != 4 ORDER BY post_date ASC LIMIT limit,1
 * Can anyone please tell me what this means? I’m totally lost.

Viewing 1 replies (of 1 total)

 *  [itzapizza](https://wordpress.org/support/users/itzapizza/)
 * (@itzapizza)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/error-in-sql-syntax/#post-125367)
 * This is SQL – used to retrieve/insert data into databases. There is a syntax 
   issue here. For some reason ‘limit,1’ is appearing. It should only be ‘1’. Make
   sure you use the version of MySQL stated in the installation guideline (I am 
   using 4.0 and not 4.1). If the file was customized, keep this in mind.
 * SELECT ID,post_title FROM wp_posts WHERE post_date > ‘2005-01-03 14:59:20’ AND
   post_date < ‘2005-01-04 13:48:45’ AND post_status = ‘publish’ AND ID != 4 ORDER
   BY post_date ASC LIMIT limit,1

Viewing 1 replies (of 1 total)

The topic ‘error in sql syntax’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [itzapizza](https://wordpress.org/support/users/itzapizza/)
 * Last activity: [21 years, 5 months ago](https://wordpress.org/support/topic/error-in-sql-syntax/#post-125367)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
