I have some problem inserting data in MySQL. The program is running without any errors but the values are not getting inserted. Below is the code. I doubt there is some mistake in format specifiers.The python version I am using is 3.5.3. Thanks in advance.
#!/usr/bin/python
import MySQLdb
# Open database connection
db = MySQLdb.connect("localhost","root","pwd","project")
# prepare a cursor object using cursor() method
cursor = db.cursor()
add_metric = ("INSERT INTO metrics " "(clicks, pageviews, sessions, source, browser,device_type)"
"VALUES (%s, %s, %s, %s, %s,%s)")
data_metric = (5,6,7,'s','a','f')
cursor.execute(add_metric, data_metric)
cursor.close();
db.close();