I am trying to do an INSERT into my table called 'outfield' which consists of the following fields: outfieldplayerID (auto-increment and PK), Surname, Forename, Team, Games Played, Games Started, Minutes Played, Goals, Assists, Shots, Shots on goal, Yellow cards, Red cards
My code is as follows:
import mysql.connector
conn = mysql.connector.connect(user='root',password ="password5",host='localhost',database='performance')
query = "INSERT INTO outfield ('Surname', 'Forename', 'Team', 'Games Played', 'Games Started', 'Minutes Played', 'Goals', 'Assists', 'Shots', 'Shots on goal', 'Yellow cards', 'Red cards') values('a','b','c','1','1','1','1','1','1','1','1','1')"
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
rows = cursor.fetchall()
cursor.close()
conn.close()
I am getting a syntax error in the INSERT line. Where am I going wrong?