looking for some solutions? You are welcome.

SOLVED: Deletion a row in database table using python

Chandio:

I wrote this code for deletion of row from table but if i enter the name which is not in table it returns "Data Deleted Successfully"

How i can handle this??

code is:

    n=input("Enter Student name you want to delete:")
    try:
        cur.execute('DELETE FROM studentdata WHERE name=?',(n,))
        print("Data Deleted Successfully")
        conn.commit()
    except:
        print("No data found with this name: ")



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent