import pymysql
connection = pymysql.connect(host=‹ localhost ›, user=‹ 123 ›, passwd=‹ 987654 ›, db=‹ py_work ›)
cursor=connection.cursor()
rfid_data = ‹ 178,365,124,327 ›
sql=‹ select uid from table1
where uid =?; › [rfid_data]
cursor.execute(sql
countrow = cursor.execute(sql)
print(« Number of rows: »,countrow)
data = cursor.fetchall()
print(data)