The best way to insert values into a database using MySQLDB would be to simply use ‘%s’. This placeholder does all the work on conversion into other data types. You dont need to worry about converting any values into their respective datatypes in mysql.
2 Replies to “MySQLDB: Python: Inserting date, integer, float and other variables into MySQL”
Thank you so much for solving my problem! I’ve been stuck for a couple hours!
Very useful solution!. Thanks