I want to print out only the value without any brackets or commas or parenthesis. I am using MySQL with python with mysql.connector.
When I run this code I get "('esrvgf',)". But I want to just get "esrvg".
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="password",
database ="mydatabase"
)
cursor = mydb.cursor()
sql = "select nick from users where ipaddress = '192.168.1.4'"
cursor.execute(sql)
myresult = cursor.fetchall()
for x in myresult:
print(x)