SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO [duplicate]

from is a keyword in SQL. You may not used it as a column name without quoting it. In MySQL, things like column names are quoted using backticks, i.e. `from`. Personally, I wouldn’t bother; I’d just rename the column. PS. as pointed out in the comments, to is another SQL keyword so it needs to … Read more

How can I fix MySQL error #1064?

TL;DR Error #1064 means that MySQL can’t understand your command. To fix it: Read the error message. It tells you exactly where in your command MySQL got confused. Examine your command. If you use a programming language to create your command, use echo, console.log(), or its equivalent to show the entire command so you can see it. Check the manual. By comparing against what … Read more