Title: SQL database error
Last modified: August 18, 2016

---

# SQL database error

 *  Resolved [tin68](https://wordpress.org/support/users/tin68/)
 * (@tin68)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/sql-database-error-2/)
 * I have set permalink on standard and URL to a posting is like
 * [http://blogkom.net/wp/?p=78](http://blogkom.net/wp/?p=78)
 * If the URL points to a non existing posting like
 * [http://blogkom.net/wp/?p=400](http://blogkom.net/wp/?p=400)
 * there is the message that this posting isn’t available.
 * But there is also an SQL error message:
 * >  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 ‘ORDER BY post_date ASC LIMIT 1’ at line 1]
   >  SELECT ID,post_title 
   > FROM wp_posts WHERE post_date > ” AND post_date < ‘2006-10-22 06:49:38’ AND
   > post_status = ‘publish’ AND ID != ORDER BY post_date ASC LIMIT 1
 * I have Worpress 2.0.4 and tried to unistall several plugins. But nothing changes.
 * If I set the permalink option to “date and name” there is no SQL error message
   when the URL points to a non existing posting.
 * Any ideas? Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [tin68](https://wordpress.org/support/users/tin68/)
 * (@tin68)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/sql-database-error-2/#post-469059)
 * I found the problem in the meantime. There was a mistake in the sidebar.php –
   a call to an additional plugin was at the wrong place.

Viewing 1 replies (of 1 total)

The topic ‘SQL database error’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [tin68](https://wordpress.org/support/users/tin68/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/sql-database-error-2/#post-469059)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
