The next step would have been to include the error message in your request for help, that way we can help you debug the query based on what MySQL is wrong with it.
As for your problem, I expect MySQL is telling you the problem is near the "to" part of the query. That should tell you that the column name itself seems to be causing the problem.
And so it is; the word TO is a MySQL reserved word. In other words, you must either delimit this word in all of your queries (usually done with backticks in MySQL, to denote that you're using an identifier instead of a reserved word), or simply don't use one of the reserved words as an identifier.