I have some pages that make PDO queries using prepare() and execute() (binding some parameters) and they work fine on localhost, but are failing online with messages like this:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user ...
How do I debug this? I have no idea what is wrong, as it works on my development server (localhost), and I am new to PDO and don’t know what to do.
I should also note that at least some of the PDO queries are working.
Thanks.
The error message is pretty clear, the user you are using on your webserver does not have permission to insert a record. You need to set the correct permissions using the mysql command line or something like phpMyAdmin if you have it installed on the web-server.