cursor = db.cursor() stmt = "SELECT * from books" cursor.execute(stmt)
rows = cursor.fetchall () for row in rows: print "Row: " for col in row : print "Column: %s" % (col) print "End of Row" print "Number of rows returned: %d" % cursor.rowcount
cursor.close()
db.close()
Related Scripts with Example Source Code in same category :