The below is the python code to insert row in mysql
self.db = MySQLdb.connect(host='localhost', user='root', password='1234', db='plotproject')
self.cur = self.db.cursor()
siteno = self.lineEdit_43.text() # providing siteno
siteaddress = self.plainTextEdit.text() # providing siteaddress
pincode = self.lineEdit_45.text() # providing sitepincode
area = self.lineEdit_46.text() # providing sitearea
self.cur.execute('''
INSERT INTO unregisteredsites(siteno,siteaddress,pinid,area)
VALUES (%d , %s ,%d ,%s)
''', (siteno, siteaddress, pincode, area))
self.db.commit()
print("done")
This code couldn't insert row in mysql below is the error it returns
Process finished with exit code -1073740791 (0xC0000409)
The Database is
create table unregisteredsites(
siteno number(5),
siteaddress varchar(30),
pinid number(6),
area varchar(10),
);
What is wrong in it
question from:https://stackoverflow.com/questions/65651854/couldnt-insert-row-in-database-from-pyqt5-and-mysql