import mysql.connector
mydb = mysql.connector.connect(host= 'localhost', user='root', passwd="barbie", db='data')
mycursor = mydb.cursor() #execute, fetch data act as a pointer
print("Connected to database")
query = ("select name , matric from users where username = %s")
username = 'shawn'
mycursor.execute(query, (username))
print ("Fetching single row")
record = mycursor.fetchone
print (record)
The errors
Why do I get this kind of error? I only want to display the row.
The table from my database