I've been trying to make the following code work but have not found a way. Im new to both MySQL and Python and connecting Python with MySQL is something i recently learned for my college project.
password = input("Enter Password Here")
conn2 = mysql.connector.connect(host="localhost", user="root", password="root", database="trial")
c2 = conn2.cursor()
c2.execute("select lastname from table1 where lastname= '?' ", (password))
row1 = c2.fetchone()
c2.execute("""select lastname from table1 where lastname= %s""", (password,))