我在以下
Python代码中收到错误:
import MysqL.connector cnx = MysqL.connector.connect(user='root',password='',host='127.0.0.1',database='DB') cursor = cnx.cursor() Name = "James" Department = "Finance" StartYear = 2001 CurrentPos = 2001 Link = "" add_user = ("INSERT INTO DB.tbluser " "(username,department,startyear,currentpos,link) " "VALUES (%s,%s,%d,%s)") data_user = (Name,Department,StartYear,CurrentPos,Link) cursor.execute(add_user,data_user) cnx.commit() cursor.close() cnx.close()
错误消息是
MysqL.connector.errors.ProgrammingError: Not all parameters were used in the sql statement
你明白为什么吗