Store Selected data in a variable with MySQL.connector and Python
How do I get the selected data into a variable?
sql2 = "SELECT * FROM testTable WHERE id=1" cursor.execute(sql2)
If I assign cursor.execute(sql2)
to x, and print x, x is None
. How do I store the info selected in a variable?
Also is my syntax correct for the SQL statement?