You have an error in your SQL syntax

Error Type: 
MySQL
Severity: 
Error
Origin: 
custom
Description: 

SQL is the language used to query and manipulate relational databases. The most common types of SQL statement are:

SELECT
INSERT
UPDATE
DELETE

This message is telling us that a SQL statement was submitted to the database server, typically MySQL, and the database server responded by informing us the the statement was incorrectly formatted.

 

 

Cause: 

The most common cause for this error message is a simple typo, for example a miss-spelled field name.

Another cause that we see often is where the SQL statement contains the "IN()" opearator, for example to supply a list of node IDs to filter on, but where the PHP code does not first sanity check that there are actually some values to pass to the "IN()" operator, resulting in a malformed SQL statement.

Solution: 

Start by getting the actual SQL that hits the database and then look carefully for typos. If nothing seems obvious, start breaking the SQL statement down and executing the simplified statements directly, either with a GUI or CLI, and this should help you home in on exactly where the problem lies.

Expedite

Our aim is to add enough detailed information to each of the Drupal error messages that Drupal developers will be able to fix their own problems. This exercise will take some time to complete, at the last count we had almost 700 error messages in the system.

If your site is suffering from this error message please contact us and ask us to expedite the solution to this error and we will do our best to add a solution as soon as possible.