I basically have 2 python scripts one is for frontend other is for backend. On Frontend I have this:
def delete_command():
back.delete(selected_tuple[0])
So basically click on a entry in a listbox then on backend script it has the database call (sqllite3)
def delete(id):
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_path = os.path.join(BASE_DIR, "AVDatabase.db")
conn=sqlite3.connect(db_path)
cur=conn.cursor()
cur.execute('DELETE * FROM "Books" where BookId=?',(BookId,))
conn.commit()
conn.close()
But i keep getting an error:
cur.execute('DELETE * FROM "Books" where BookId=?',(BookId,))
NameError: name 'BookId' is not defined
The database already exists so its not dynamically created not sure why it considers the BookID column as not defined, BookID is a primary key integer on the main Books Table.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)