Helo ,
I am working actualy on a function that delete a row from a table in a database , it works good with this python code :
def supprimer():
global rows
global element
global listelement
idsupprvar = idsuppr_entry.get()
db = MySQLdb.connect(host = "localhost", user = "user", passwd = "123456",db = "users",charset = "utf8" , use_unicode=True)
curs = db.cursor()
#curs.execute('SELECT idpersonne FROM parcinfo;')
#rows = curs.fetchall()
#if rows :
# for z in rows:
# if idsupprvar == z[0] :
print idsupprvar
curs.execute("DELETE FROM users.parcinfo WHERE idpersonne = %s"%(idsupprvar))
curs.close()
db.commit()
lab1.config(text="l'enregistrement dont l'id = '%s' a été bien supprimé de la base de données"%(idsupprvar))
idsuppr_entry.delete(0,END)
labsupprimer.config(text="Pour supprimer un autre enregistrement , saisir son id puis cliquer sur supprimer")
my question is how to check if the "idpersonne" exist before deleting it row .