I take a successful SELECT request for mysql but one row is a number but python converts it to an integer and the result is that the zero was removed from beginning. But I want that the zero isn't removed from beginning. Is there a way to do it?
My Code
sql = mysql.connector.connect(user='XXX', password='XXX',
host='localhost',
database='database'
)
cursor = sql.cursor()
cursor = sql.cursor(dictionary=True)
cursor.execute("SELECT * FROM database WHERE language='de' AND searchnumber='0290661' ")
myresult = cursor.fetchall()
for row in myresult: searchnumber = row['searchnumber'] # searchnumber = str(row['searchnumber']) has no effect
print(searchnumber) # return 290661 but it should be 0290661