So far this is the code I have and I keep getting an error stating:
“sqlite3.OperationalError: near “)”: syntax error”
import sqlite3
con = sqlite3.connect("DatabaseName.sql")
cur = con.cursor()
cur.execute("""CREATE TABLE Contacts (Fname TEXT,
Lname TEXT, Phone INTEGER,)""")
Fname = input("Enter first name: ")
Lname = input("Enter last name: ")
Phone = input("Enter telephone number(no dashes or spaces): ")
Phone = int(Phone)
cur.execute("""INSERT INTO Contacts (Fname, Lname, Phone, joined_club)
VALUES (?,?,?)""", (Fname,Lname,Phone))
con.commit()
cur.close()
con.close()
You have an extra comma in your create statement, before the close paren. It should be:
Later on, you have an extra parameter,
joined_club, in yourINSERTstatement. It should be: