I am executing the following sql statement from python program on Mysql database.
mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="",
database="fmysql",
)
mycursor = mydb.cursor()
sql = "SELECT f_name FROM STUDENTS where ID_No = %s " % self.leID_no.text()
mycursor.execute(sql)
where self.ID_no.text()is a QLineEdut field in pyqt5 form. this code is showing an error when the leID_no text is an Arabic number digits e.i. (١٢٣),the error message is:
mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column '١٢٣' in 'where clause'
but when leID_no text is an english number digits (0-9), the query run with no errors!
I am using the following setup: mac, python3.8, pyqt5, Mysql, charset (utf8, utf8_unicode_ci)
any help to solve this problem?