Skip to content
Advertisement

pymysql.err.ProgrammingError Error while Inserting Row into MySQL table (using Python, Flask, ClearDB)

I have seen numerous posts about this but I have not been able to fix this issue. I am converting my database from SQLite to MySQL and am having an issue when inserting values into a table. In this statement, the keyword and sortType are variables that are passed into the method and not modified. keyword, type_search, and sort are of type TEXT while date_add is of type DATE.

Error:

I changed date to date_add as it was a keyword but this did not fix the issue. How can I fix this?

Thanks!

Advertisement

Answer

You could also create the table with the column default of the current timestamp:

Then you could do the execute without mentioning the date_add column and it will be the current timestamp.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement