Hi,
I want to know how to use Python variables in My sql statement and below is the syntax i am using
import MySQLdb
name="XYZ"
number="123456"
db=MySQLdb.Connect("localhost","root","12345","phone")
cursor=db.cursor()
sql= ("""INSERT INTO phonebook(number, Mobile) VALUES(%s,%s)""" , name,number)
cursor.execute(sql)
db.commit()
db.close()
but this throws the error
please refer the attached screen shot for the error and help me out