MySQLDB: Python: Inserting date, integer, float and other variables into MySQL

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.

In

2 responses

  1. Thank you so much for solving my problem! I’ve been stuck for a couple hours!

  2. Douglas Avatar
    Douglas

    Very useful solution!. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *