Skip to content Skip to sidebar Skip to footer

Mysql Db Call: Not All Arguments Converted During String Formatting

I get the error not all arguments converted during string formatting, when I execute the below-given code: pro_title = 'FSBT' print 'pro_title: ' + pro_title pro_id_query = 'SELECT

Solution 1:

pro_title = "FSBI" 
pro_id_query = "SELECT * FROM %s"%(pro_title)
cursor = con.cursor() 
cursor.execute(q) 
result_list = result.fetchall()   
result_list[0][0] 
con.commit() 
con.close()

pro_id_query = cursor.fetchone() while row != False:
print ("The ID is : ", row[0])

*edit

id = input("Id : ")
name = input("Name : ")
cursor = con.cursor()
cursor.execute(""" INSERT INTO names (id, name) VALUES("%s", "%s")"""
          %(id, name))

Post a Comment for "Mysql Db Call: Not All Arguments Converted During String Formatting"