Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This sounds absolutely trivial, but still can be tricky to find. I recommend you approach the possibility of incorrect SQL syntax very rigorously, like any other possible problem.
An error such as the following is easy to see:
SELECT * FRO t1 WHERE f1 IN (1,2,1);
In this case, it is clear that the user just forgot to type an “m”, and the error message clearly reports this (I have broken the output lines to fit the page):
mysql> SELECT * FRO t1 WHERE f1 IN (1,2,1);
ERROR 1064 (42000): 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 'FRO
t1 WHERE f1 IN (1,2,1)' at line 1
Unfortunately, not all syntax errors are so trivial. I once worked on a trouble ticket concerning a query like this: