'How to check mysql table with python

I want to create a license system for my codes in python. Now I am facing an issue: how can I check if an integer is contained in my MySQL database?

Here are some variables for the database.

'License' Database: license|user
Database name = License
colummns = license and user 

Here is my code I got so far:

def check_data():
    license = str(11585728)
    val = f'"18742974","USER"'
    sql = "SELECT * FROM License WHERE license = ''11585728''"

    cursor.execute(sql)
    conn.commit()
    cursor.execute("SHOW DATABASES")``` 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source