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]
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]