```
cur = conn.cursor()

result = cur.execute("SELECT * FROM users WHERE username = %s", [username])
if result > 0:
    data = cur.fetchone()
    password = data['password']

if sha256_crypt.verify(password_given, password):
    app.logger.info('PASSWORD MATCHED')
else:
    app.logger.info('PASSWORD Not MATCHED')

```

this is the actual code am using. i think the error is coming from variable 'result', i want it to get the stored password as dictionary.