This is the error I am getting.
PDOException: Uncaught exception 'PDOException' with message 'SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x98\xB3' for column 'string' at row 1'
I know the problem here. The column table is using utf8. The utf8 encoding cannot store 4 byte characters so it errors. A way to get around this could be to use utf8mb4 instead.
My question instead is about the error message. We are using MariaDB. Why does it say "Invalid datetime format" in the error message? This is a text field. There is nothing to do with datetime in the query being run.
This "Invalid datetime format" comes up often for a variety of errors but seems unrelated to the actual source of the error.
yyyy-mm-dd hh:mm:ss. Given your\xF0, you're passing something not even remotely CLOSE to that form. And since you haven't shown your actual query, we can't do anything to help you. - Marc Butf8encoded string as adatetimeparameter, that's all. - MjhSHOW CREATE TABLEand the SQL directly involved in the error message. - Rick James