-4

I am trying to create a software for teachers to manage their students grades (it's a project I chose in my computer class). Sadly I'm failing at SQLite. I created a function but when putting the input from calling the function in, it gives my the error: No such Column: Doe

the code causing this error is:

cur.execute("INSERT INTO students(surname, name, class, teacher) VALUES (?,?,?,?)",
        (lname, fname, students_class, class_teacher))  # adding new student

Here is my code: https://pastebin.com/bptb7C0w

  • 1
    In the statement you have posted you are (appropriately) using SQL parameters; but in other queries in your code you are using f-strings to glue values into your statement. Don't do that. It is unsafe and it causes errors like the one you have encountered. – khelwood Jun 01 '22 at 12:56
  • Creating tables for each student is big No-No – buran Jun 01 '22 at 13:00

0 Answers0