mysql - Fix error "TypeError: 'long' object is not iterable" mysql - Fix error "TypeError: 'long' object is not iterable" flask flask

mysql - Fix error "TypeError: 'long' object is not iterable"


Since your query returns a single record, there is no need to iterate.

So:

x.execute("SELECT COUNT(temp) from sensors")row = x.fetchone()maxNumberRows = row[0]