I am working on database connectivity in Python 3.4. There are two columns in my database.
Below is the query which gives me all the data from two columns in shown f
To iterate over and print rows from cursor.fetchall()
you'll just want to do:
for row in data:
print row
You should also be able to access indices of the row, such as row[0]
, row[1]
, iirc.
Of course, instead of printing the row, you can manipulate that row's data however you need. Imagine the cursor as a set of rows/records (that's pretty much all it is).