This is the code I have: r = '' while True: data = result.fetch_row() r+= record[0][0] + record[0][1] + record[0][0] print r What I want to do is, first fetch all the rows: data = result.fetch_row(0) and then run a loop for "data" rather than do it within the while loop. Continue reading...