Creating a new record

A new record needs to be created every time a user enters a new name and a phone number in the entry widgets provided, and then clicks on the Add Record button.

The database query for adding a new record is as follows:

query = 'INSERT INTO contacts VALUES(NULL,?, ?)'parameters = (self.namefield.get(), self.numfield.get())self.execute_db_query(query, parameters)

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.