vendredi 31 juillet 2020

TypeError: -not all arguments converted during string formatting

from tkinter import *
import tkinter as tk
import psycopg2



root = Tk()

def get_data(name,age,address):
    conn = psycopg2.connect(dbname="postgres", user="postgres", password="postgres", host="127.0.0.1", port="8080")
    cur = conn.cursor()
    query = '''INSERT INTO student (NAME,AGE,ADDRESS) VALUES (%s,%s,%s);'''
    cur.execute(query, ["name, age, address"])
    print("DATA INSERTED")
    conn.commit()
    conn.close()


error:

TypeError: not all arguments converted during string formatting

where is the problem and in addition id is registerd as serial in database




Aucun commentaire:

Enregistrer un commentaire