I am trying to retrieve a value from a table stored in Mysql database using python(pycharm). But instead of outputting the stored value it outputs number of rows instead.
import pymysql
connection = pymysql.connect(host='localhost',
user='root',
password='passw',
database='database1',
charset='utf8',
port=3306
)
x=connection.cursor()
select = x.execute('''SELECT
update_id
FROM
telegram;
''')
print(select)
Output: 1
^Wrong output(Output equals number of rows). As I keep adding on rows the output changes to the number of rows but never returns the value stored.
The command works from MySql perfectly.
SELECT
update_id
FROM
telegram;
Output:233
^This is the correct output. Why is this happening? What changes should I make in my python code?
