GAME_IDs [& quot; resultSets & quot;] [0] [& quot; rowSet & quot;] [I] [0] TEAM_IDs [& quot; resultSets & quot;] [0] [& quot; rowSet & quot;] [I] [1] PLAYER_NAMEs [& quot; resultSets & quot;] [0] [& quot; rowSet & quot;] [I] [5] dbMySQLdb. connect (& quot; localhost & quot;, & quot; ro mysqlsqlpython database
GAME_ID = s ["resultSets"] [0] ["rowSet"] [I] [0]
TEAM_ID = s ["resultSets"] [0] ["rowSet"] [I] [1]
PLAYER_NAME = s ["resultSets"] [0] ["rowSet"] [I] [5]
Db = MySQLdb. connect ("localhost", "root", "199536abc", "test ")
Cursor = db. cursor ()
SQL = "" INSERT INTO PLAYER (GAME_ID, TEAM_ID, NAME)
VALUES (GAME_ID, TEAM_ID, PLAYER_NAME )"""
Try:
# Execute SQL statements
Cursor.exe cute (SQL)
# Submit to database for execution
Db. commit ()
Except t:
# Rollback in case there is any error
Db. rollback ()
The problem is that the three values in the brackets following the values in the SQL statement are not the previously defined GAME_ID, TEAM_ID, PLAYER_NAME, and can only be fixed values such as 21212, 1212, and nick.